Exec Java mojo does an NPE for system properties with no value
--------------------------------------------------------------

                 Key: MEXEC-10
                 URL: http://jira.codehaus.org/browse/MEXEC-10
             Project: Mojo Exec Plugin
          Issue Type: Bug
    Affects Versions: 1.0.1
            Reporter: Jerome Lacoste
            Priority: Critical


Reported by "BEHRING Carsten"

Dear Jerome,
 
as I did not find an other way to report a bug for the
exec-maven-plugin, allow me to do it via email.
 
I use the exec-maven-plugin to run a little program that uses hibernate
for database access.
 
I want to pass parameters via systemProperties and configure the plugin
like this:
 
 
   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
     <execution>
      <goals>
       <goal>java</goal>
      </goals>
     </execution>
    </executions>
    <configuration>
     <systemProperties>
 ....
      </property>
         <key>ds.password</key>
         <value></value>
      </property>
     </systemProperties>
    </configuration>
   </plugin>

 
The "ds.password" value needs to be "empty string". If I run it this way
I get an NPE:
 
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:396)
        at java.util.Properties.setProperty(Properties.java:128)
        at java.lang.System.setProperty(System.java:700)
        at
org.codehaus.mojo.exec.ExecJavaMojo.setSystemProperties(ExecJavaMojo.jav
a:163)
        at
org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:106)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:412)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:534)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
l(DefaultLifecycleExecutor.java:488)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:458)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:306)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.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.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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)
 
Is there an other way to sepcify an empt string for it ?
 
If I do the same for the an other plugin, the "maven-surefire-plugin",
it works.

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

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to