maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MTStorm (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MSHARED-80) NullPointer in DefaultDependencyTreeBuilder.java:93, no logger
Date Wed, 05 Nov 2008 00:16:51 GMT

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

MTStorm commented on MSHARED-80:
--------------------------------

Did some more research. I have copied a TreeMojo from maven-dependency-tree to a standalone
maven plugin and I had the same problem. I have also downgraded the version from 1.2 to 1.1
and I have the same Nullpointer.

I forgot the stracktrace, oeps here it is for the bug
java.lang.NullPointerException
	at org.apache.maven.shared.dependency.tree.DefaultDependencyTreeBuilder.buildDependencyTree(DefaultDependencyTreeBuilder.java:93)
	at net.sourceforge.miauwframework.maven.dependencies.plugin.DependenciesReportMojo.constructDependencyStructure(DependenciesReportMojo.java:274)
	at net.sourceforge.miauwframework.maven.dependencies.plugin.DependenciesReportMojo.beforeExecuteReport(DependenciesReportMojo.java:362)
	at net.sourceforge.miauwframework.plugins.maven.common.AbstractMiauwframworkReport.executeReport(AbstractMiauwframworkReport.java:116)
	at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
	at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:139)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
	at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
	at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:129)
	at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
 

> 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
>            Priority: Critical
>
> 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

        

Mime
View raw message