More friendly failure message when scm.getConnection() returns null during a 
release
------------------------------------------------------------------------------------

                 Key: MRELEASE-167
                 URL: http://jira.codehaus.org/browse/MRELEASE-167
             Project: Maven 2.x Release Plugin
          Issue Type: Bug
    Affects Versions: 2.0-beta-4
         Environment: Windows XP
            Reporter: Harold Shinsato


Doing a release:prepare, this failure occurred.  Not sure why, but the source 
code shows (PropertiesReleaseConfigurationStore.write - line 225) that 
scm.getConnection() returned a null.  The scm worked earlier in the phase, so 
not sure why it would be null, but a more friendly message here might have 
shown what the problem was.  It does seem it would be wiser to have a check for 
scm.getConnection() != null before trying to put the connection into the 
properties list.

Here's the crash stack.


java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:396)
        at java.util.Properties.setProperty(Properties.java:128)
        at 
org.apache.maven.plugins.release.config.PropertiesReleaseConfigurationStore.write(PropertiesReleaseConfigurationStore.java:225)
        at 
org.apache.maven.plugins.release.config.PropertiesReleaseConfigurationStore.write(PropertiesReleaseConfigurationStore.java:149)
        at 
org.apache.maven.plugins.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:145)
        at 
org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:106)
        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.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:219)
        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)

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

        

Reply via email to