getLog().warn( "Ignoring artifact due to dependency cycle " + project.getArtifact() );
return null;
}
m_artifactsBeingProcessed.add( project.getArtifact() );
DependencyNode dependencyTree;
try
{
dependencyTree = m_dependencyTreeBuilder.buildDependencyTree( project, localRepository, m_factory,
m_artifactMetadataSource, null, m_collector );
}
catch ( DependencyTreeBuilderException e )
{
throw new MojoExecutionException( "Unable to build dependency tree", e );
}
BundleInfo bundleInfo = new BundleInfo();
if ( !dependencyTree.hasChildren() )
{
/* no need to traverse the tree */
return bundleRoot( project, bundleInfo );
}
getLog().debug( "Will bundle the following dependency tree" + LS + dependencyTree );
for ( Iterator it = dependencyTree.inverseIterator(); it.hasNext(); )
{
DependencyNode node = ( DependencyNode ) it.next();
if ( !it.hasNext() )
{
/* this is the root, current project */
break;
}
if ( node.getState() != DependencyNode.INCLUDED )
{
continue;
}
if ( Artifact.SCOPE_SYSTEM.equals( node.getArtifact().getScope() ) )
{
getLog().debug( "Ignoring system scoped artifact " + node.getArtifact() );
continue;
}
Artifact artifact;
try
{
artifact = resolveArtifact( node.getArtifact() );
}
catch ( ArtifactNotFoundException e )
{
if ( ignoreMissingArtifacts )
{
continue;
}
throw new MojoExecutionException( "Artifact was not found in the repo" + node.getArtifact(), e );
}
node.getArtifact().setFile( artifact.getFile() );
int nodeDepth = node.getDepth();
if ( nodeDepth > maxDepth )
{
/* node is deeper than we want */
getLog().debug(
"Ignoring " + node.getArtifact() + ", depth is " + nodeDepth + ", bigger than " + maxDepth );
continue;
}
MavenProject childProject;
try