[ http://jira.codehaus.org/browse/MSUREFIRE-80?page=comments#action_61320 ] 

Jason Dillon commented on MSUREFIRE-80:
---------------------------------------

So <property><name>...</name><value>...</value></property> is the 
right/perfered syntax to refer to properties?  Are other property elements 
going to change to this too?  This seems very inconsistent, and only makes the 
pom more verbose, when it is already too verbose.

Anyways... I'm just trying to make this work... and by this I mean Maven2... 
I'm really regretting having suggested to my group to start using it, as it is 
way too buggy, and way to unpredictable out of the box... 

I was just following directions on how to use surefire, and somehow I ended up 
using an unstable/development version?  How on earth did that happen?  Why is 
my build being affected by changes that developers working on plugins do.  I 
had a few developers come by with broken builds and it just turned out that 
someone accidentally released a broken plugin.

I'm soo frustrated :-(

So, how do I use the "official released version" of the surefire plugin... if I 
do that then I can change to this overly verbose syntax to simply delegate 
properties to junit, which should have already been delegated.  Stuff like this 
makes me miss Jelly, where I could have just written a snip to "do the right 
thing" in my master project and be done with it.

> systemProperties and NPE
> ------------------------
>
>          Key: MSUREFIRE-80
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-80
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Reporter: Jason Dillon
>     Priority: Blocker

>
>
> I've got in my pom:
> {code}
> <properties>
>         <jdbc.schema></jdbc.schema>
> </properties>
> {code}
> And then configured the surefire plugin to set a system property:
> {code}
> <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-surefire-plugin</artifactId>
>                 <configuration>
>                     <systemProperties>
>                         
> <dbunit.connection.schema>${jdbc.schema}</dbunit.connection.schema>
>                     </systemProperties>
>                 </configuration>
>             </plugin>
> {code}
> Which ends up resulting in:
> {noformat}
> [DEBUG]   (f) systemProperties = {dbunit.connection.schema=null}
> ...
> [DEBUG] Trace
> java.lang.NullPointerException
>         at java.util.Hashtable.put(Hashtable.java:393)
>         at java.util.Properties.setProperty(Properties.java:102)
>         at java.lang.System.setProperty(System.java:656)
>         at 
> org.apache.maven.test.SurefirePlugin.processSystemProperties(SurefirePlugin.java:408)
>         at 
> org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:335)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>         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:249)
>         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:324)
>         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}
> If I put any value into the property, like
> {code}
> <properties>
>         <jdbc.schema>foo</jdbc.schema>
> </properties>
> {code}
> Then it works as expected, no NPE and the property gets set.
> But I need to set the property to an empty string... why on earth does this 
> get turned into a null?

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