[ http://jira.codehaus.org/browse/MDEP-67?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Fox closed MDEP-67. ------------------------- Resolution: Fixed Fix Version/s: 2.0-alpha-2 fixed npe and then added a new use case. Previously it would only match artifacts in dependencies/depMgt that where exact matches: artifactId/groupId/classifier/type. Now if it doesn't find an exact match, it will re-search but ignoring classifier and type. The described pom is now a valid case and added to IT tests. > NPE when resolving the version of a dependency > ---------------------------------------------- > > Key: MDEP-67 > URL: http://jira.codehaus.org/browse/MDEP-67 > Project: Maven 2.x Dependency Plugin > Issue Type: Bug > Affects Versions: 2.0-alpha-1 > Reporter: Stephane Nicoll > Assigned To: Brian Fox > Fix For: 2.0-alpha-2 > > > In my project I have the following dependency > {noformat} > <dependency> > <groupId>com.foo.shared.bar</groupId> > <artifactId>foo-bar</artifactId> > <version>5.8.3</version> > <classifier>obfuscated</classifier> > </dependency> > {noformat} > I try to get the sources without specifying the version so I have the > following config: > {noformat} > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-dependency-plugin</artifactId> > <executions> > <execution> > <id>copy</id> > <phase>compile</phase> > <goals> > <goal>copy</goal> > </goals> > <configuration> > <artifactItems> > <artifactItem> > <groupId>com.foo.shared.bar</groupId> > <artifactId>foo-bar</artifactId> > <type>java-source</type> > > <outputDirectory>${project.build.directory}/foo-sources</outputDirectory> > > </artifactItem> > </artifactItems> > </configuration> > </execution> > </executions> > </plugin> > {noformat} > And I got this > {noformat} > java.lang.NullPointerException > at > org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.fillMissingArtifactVersion(AbstractFromConfigurationMojo.java:230) > at > org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems(AbstractFromConfigurationMojo.java:136) > at > org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.execute(CopyMojo.java:65) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) > 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) > {noformat} -- 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