Index: src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (revision 1167232) +++ src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (working copy) @@ -77,7 +77,7 @@ */ protected boolean appendOutput; - protected Set resolveDependencyArtifacts( MavenProject theProject ) + protected void resolveDependencyArtifacts(MavenProject theProject, Set theResolvedArtifacts, Set theUnresolvedArtifacts) throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException { Set artifacts = @@ -87,9 +87,23 @@ for ( Artifact artifact : artifacts ) { // resolve the new artifact - this.resolver.resolve( artifact, this.remoteRepos, this.getLocal() ); + if (!theResolvedArtifacts.contains(artifact)) { + try { + this.resolver.resolve(artifact, this.remoteRepos, this.getLocal()); + } catch (ArtifactNotFoundException anfe) { + theUnresolvedArtifacts.add(this.factory.createArtifact(anfe.getGroupId(), anfe.getArtifactId(), anfe.getVersion(), "", "")); + } + theResolvedArtifacts.add(artifact); + + // now resolve it's dependencies + try { + this.resolveArtifactDependencies(artifact, theResolvedArtifacts, theUnresolvedArtifacts); + } catch (ProjectBuildingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } - return artifacts; } /** @@ -105,7 +119,7 @@ * @throws ProjectBuildingException * @throws InvalidDependencyVersionException */ - protected Set resolveArtifactDependencies( Artifact artifact ) + protected void resolveArtifactDependencies( Artifact artifact, Set theResolvedArtifacts, Set theUnresolvedArtifacts ) throws ArtifactResolutionException, ArtifactNotFoundException, ProjectBuildingException, InvalidDependencyVersionException { @@ -114,6 +128,6 @@ MavenProject pomProject = mavenProjectBuilder.buildFromRepository( pomArtifact, this.remoteRepos, this.getLocal() ); - return resolveDependencyArtifacts( pomProject ); + resolveDependencyArtifacts( pomProject, theResolvedArtifacts, theUnresolvedArtifacts); } } Index: src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java (revision 1167232) +++ src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java (working copy) @@ -102,7 +102,14 @@ if ( !excludeTransitive ) { - for ( Artifact artifact : resolveArtifactDependencies( plugin ) ) + Set theResolvedArtifacts = new HashSet(); + Set theUnresolvedArtifacts = new HashSet(); + try { + resolveArtifactDependencies(plugin, theResolvedArtifacts, theUnresolvedArtifacts); + } catch (StackOverflowError e) { + e.printStackTrace(); + } + for ( Artifact artifact : theResolvedArtifacts) { logStr = " Plugin Dependency Resolved: " + DependencyUtil.getFormattedFileName( artifact, false ); @@ -118,6 +125,22 @@ outputWriter.write( "\n" ); } } + for ( Artifact artifact : theUnresolvedArtifacts) + { + logStr = + " Plugin Dependency Unresolved: " + DependencyUtil.getFormattedFileName( artifact, false ); + + if ( !silent ) + { + this.getLog().warn( logStr ); + } + + if ( outputWriter != null ) + { + outputWriter.write( logStr ); + outputWriter.write( "\n" ); + } + } } } } @@ -141,6 +164,9 @@ { throw new MojoExecutionException( "Nested:", e ); } + catch (Throwable t) { + t.printStackTrace(); + } finally { IOUtil.close( outputWriter );