maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elliot Metsger (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MRELEASE-318) Release plugin throws NullPointerException when using version range for dependency
Date Mon, 28 Feb 2011 15:19:22 GMT

    [ http://jira.codehaus.org/browse/MRELEASE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257983#action_257983
] 

Elliot Metsger commented on MRELEASE-318:
-----------------------------------------

I'm still getting an NPE with Maven 2.2.1 and Release Plugin 2.1.

Relavent POM snip:
  <dependencies>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>[1.2,)</version>
    </dependency>

    ...
  </dependencies>

Output:
mvn org.apache.maven.plugins:maven-release-plugin:2.1:prepare -DreleaseVersion=1.0.1-y2pilot
-DdevelopmentVersion=1.0.2-y2pilot-SNAPSHOT -Dtag=1.0.1-y2pilot -DdryRun=true
[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   common-services
[INFO]   dcs-id-api
[INFO]   dcs-id-impl
[INFO]   dcs-notify-api
[INFO]   dcs-notify-impl
[INFO]   Common DCS utilities
[INFO]   dcs-id-impl-hibernate
[INFO] ------------------------------------------------------------------------
[INFO] Building common-services
[INFO]    task-segment: [org.apache.maven.plugins:maven-release-plugin:2.1:prepare] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [release:prepare {execution: default-cli}]
[INFO] Verifying that there are no local modifications...
[INFO]   ignoring changes on: pom.xml.next, release.properties, pom.xml.releaseBackup, pom.xml.backup,
pom.xml.branch, pom.xml.tag
[INFO] Executing: /bin/sh -c cd /Users/esm/dc-svn/common-services/branches/y2pilot &&
svn --non-interactive status
[INFO] Working directory: /Users/esm/dc-svn/common-services/branches/y2pilot
[INFO] Checking dependencies and plugins for snapshots ...
There are still some remaining snapshot dependencies.
: Do you want to resolve them now? (yes/no) no: : yes
Dependency type to resolve,: specify the selection number ( 0:All 1:Project Dependencies 2:Plugins
3:Reports 4:Extensions ): (0/1/2/3) 1: : 
Dependency 'org.dataconservancy:project-pom' is a snapshot (1.0.1-y2pilot-SNAPSHOT)
: Which release version should it be set to? 1.0.1-y2pilot: : 
What version should the dependency be reset to for development? 1.0.1-y2pilot: : 1.0.2-y2pilot-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] version was null for commons-codec:commons-codec
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException: version was null for commons-codec:commons-codec
	at org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:390)
	at org.apache.maven.artifact.DefaultArtifact.isSnapshot(DefaultArtifact.java:562)
	at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkArtifact(CheckDependencySnapshotsPhase.java:273)
	at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkArtifact(CheckDependencySnapshotsPhase.java:252)
	at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkProject(CheckDependencySnapshotsPhase.java:136)
	at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.execute(CheckDependencySnapshotsPhase.java:98)
	at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.simulate(CheckDependencySnapshotsPhase.java:290)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:199)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
	at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:279)
	at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:237)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
	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:597)
	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] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Mon Feb 28 10:08:25 EST 2011
[INFO] Final Memory: 19M/81M
[INFO] ------------------------------------------------------------------------



> Release plugin throws NullPointerException when using version range for dependency
> ----------------------------------------------------------------------------------
>
>                 Key: MRELEASE-318
>                 URL: http://jira.codehaus.org/browse/MRELEASE-318
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-7
>            Reporter: David Hoffer
>            Assignee: Brett Porter
>            Priority: Blocker
>             Fix For: 2.1
>
>         Attachments: MNG-3351-unittest.patch, MNG-3351.zip, MNG-3351_dependency_poms.zip,
simple-test-case-console-log.txt, simple-testcase.zip
>
>
> After upgrading to 2.0.8 I find that the release plugin throws NPE if any dependency
uses version range.
> I have one dependency with version range <version>[1.0,2.0)</version> the
rest are test scope with fixed version.
> Here is the crash stack trace:
> java.lang.NullPointerException: version was null for com.xrite:xrite-colorlib-api
> [13:42:05]: at org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:362)
> [13:42:05]: at org.apache.maven.artifact.DefaultArtifact.isSnapshot(DefaultArtifact.java:557)
> [13:42:05]: at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkArtifact(CheckDependencySnapshotsPhase.java:252)
> [13:42:05]: at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.checkProject(CheckDependencySnapshotsPhase.java:138)
> [13:42:05]: at org.apache.maven.shared.release.phase.CheckDependencySnapshotsPhase.execute(CheckDependencySnapshotsPhase.java:106)
> [13:42:05]: at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:194)
> [13:42:05]: at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:131)
> [13:42:05]: at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:94)
> [13:42:05]: at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:127)
> [13:42:05]: at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:228)
> [13:42:05]: at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
> [13:42:05]: at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
> [13:42:05]: at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
> [13:42:05]: at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
> [13:42:05]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [13:42:05]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [13:42:05]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [13:42:05]: at java.lang.reflect.Method.invoke(Method.java:597)
> [13:42:05]: at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> [13:42:05]: at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> [13:42:05]: at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> [13:42:05]: at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> It seems the reason version is null is that the call to selectVersionFromNewRangeIfAvailable()
assumes that versionRange.getRecommendedVersion() will always return non-null, else it sets
the version to null!  However during the release:prepare phase this is not true, see the output:
> [13:42:04]: [INFO] [release:prepare]
> [13:42:04]: [INFO] Verifying that there are no local modifications...
> [13:42:04]: [INFO] Executing: svn --non-interactive status
> [13:42:04]: [INFO] Working directory: C:\BuildAgent\work\23044d751bcc9843
> [13:42:05]: [INFO] Checking dependencies and plugins for snapshots ...
> [13:42:05]: TEST!!! version=null
> [13:42:05]: TEST!!! versionRange=[1.0,2.0)
> [13:42:05]: TEST!!! getRecommendedVersion=null
> TEST!!! Lines are my test code so I could see what is going on here.

-- 
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