You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gin-Ting Chen (JIRA)" <ji...@codehaus.org> on 2008/12/31 00:58:19 UTC

[jira] Commented: (MSHARED-80) NullPointer in DefaultDependencyTreeBuilder.java:93, no logger

    [ http://jira.codehaus.org/browse/MSHARED-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=159491#action_159491 ] 

Gin-Ting Chen commented on MSHARED-80:
--------------------------------------

Any resolution to this issue?
I'm having a slightly different issue.
When I copy the code from {{TreeMojo}}
I have what MTStorm [has|http://jira.codehaus.org/browse/MSHARED-80?focusedCommentId=153181&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_153181]

But I get the following when invoking this plugin:

[code]
[INFO] Internal error in the plugin manager executing goal 'test:maven-test-plugin:1.0-SNAPSHOT:generate': Unable to find the mojo 'test:maven-test-plugin:1.0-SNAPSHOT:generate' in the plugin 'test:maven-test-plugin'
Component descriptor cannot be found in the component repository: DependencyTreeBuilder.
[code]

This is with maven 2.0.9

> NullPointer in DefaultDependencyTreeBuilder.java:93, no logger 
> ---------------------------------------------------------------
>
>                 Key: MSHARED-80
>                 URL: http://jira.codehaus.org/browse/MSHARED-80
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-dependency-tree
>    Affects Versions: maven-dependency-tree 1.2
>         Environment: Windows XP 64 JDK 1.6
>            Reporter: MTStorm
>            Assignee: Mark Hobson
>            Priority: Critical
>         Attachments: simple-project.zip
>
>
> I have a report and a mojo that seeks transversal dependencies. It shows a nullpointer in the DefaultDependencyTreeBuilder. 
> I can not figure it out what is wrong sice the implementation off DependencyTreeBuilder is assigned by Maven and I have no controll on the logger. 
> Here is the code snippet
> //members
> 	/**
> 	 * Used to look up Artifacts in the remote repository.
> 	 * 
> 	 * @parameter expression=
> 	 *            "${component.org.apache.maven.artifact.factory.ArtifactFactory}"
> 	 * @required
> 	 * @readonly
> 	 */
> 	protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
> 	/**
> 	 * Used to look up Artifacts in the remote repository.
> 	 * 
> 	 * @parameter expression=
> 	 *            "${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
> 	 * @required
> 	 * @readonly
> 	 */
> 	protected org.apache.maven.artifact.resolver.ArtifactResolver resolver;
> 	/**
> 	 * Artifact collector, needed to resolve dependencies.
> 	 * 
> 	 * @component role="org.apache.maven.artifact.resolver.ArtifactCollector"
> 	 * @required
> 	 * @readonly
> 	 */
> 	protected ArtifactCollector artifactCollector;
> 	/**
> 	 * @component 
> 	 *            role="org.apache.maven.artifact.metadata.ArtifactMetadataSource"
> 	 *            hint="maven"
> 	 * @required
> 	 * @readonly
> 	 */
> 	protected ArtifactMetadataSource artifactMetadataSource;
> 	/**
> 	 * Dependency tree builder component.
> 	 * 
> 	 * @component expression=
> 	 *            "org.apache.maven.shared.dependency.tree.DependencyTreeBuilder"
> 	 * @required
> 	 * @readonly
> 	 */
> 	private DependencyTreeBuilder dependencyTreeBuilder;
> //sample snippet to use in report and mojo
> 		ArtifactFilter artifactFilter = new ScopeArtifactFilter(
> 				Artifact.SCOPE_COMPILE);
> 		DependencyNode dn;
> 		getLog().info("Start");
> 		try {
> 			dn = dependencyTreeBuilder.buildDependencyTree(
> 					project, localRepository, artifactFactory, artifactMetadataSource,
> 					artifactFilter, artifactCollector);
> 			
> 		} catch (DependencyTreeBuilderException e) {
> 			e.printStackTrace();
> 			getLog().error("oeps",e);
> 		}
> 		getLog().info("Done");

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira