[mevenide-user] Issues with maven-surefire-plugin 2.4 and system properties

Andreas Loew <Andreas.Loew-UdXhSnd/[email protected]>
Newsgroups gmane.comp.jakarta.turbine.maven.mevenide.user
Organization Sun Microsystems GmbH
Message-ID <[email protected]>
Milos, All,

it looks like the NetBeans Maven integration (for NB 5.5.1 as well as 
for 6.0) has a serious issue with the newly released 
maven-surefire-plugin 2.4 (released on Jan 15th, 2008).

It looks like, although my tests are configured to use either 
forkMode=once or forkMode=perTest, Mevenide and/or the 
maven-surefire-plugin in 2.4 either do not fork or (most probably) start 
these new JVMs by explicitly (and incorrectly) passing all the system 
properties and property values of the currently running JVM (i.e. the 
JVM running the Netbeans IDE).

This means these system properties have "interesting" values when the 
JUnit test code is running, like e.g.:

javax.xml.parsers.DocumentBuilderFactory=org.netbeans.core.startup.DOMFactoryImpl
javax.xml.parsers.SAXParserFactory=org.netbeans.core.startup.SAXFactoryImpl

As these NetBeans factory classes are not available from my project's 
Meven test classpath, all my XML-related tests do now fail.

In addition, I get a message about a missing Logger configuration class:

Logging configuration class "org.netbeans.core.startup.TopLogging" failed
java.lang.ClassNotFoundException: org.netbeans.core.startup.TopLogging

The announcement for maven-surefire-plugin 2.4:

http://www.nabble.com/-ANN--Maven-Surefire-Plugin-2.4-for-Maven-2-Released-tt14853145s177.html#a14853145

says about this:

"3) System properties [SUREFIRE-416]: Surefire allows you to configure 
the system properties of the currently running test.  By default, 
Surefire will run tests in a separate process (forkMode=once); if 
process forking is disabled (forkMode=never), Surefire will set the Java 
system properties of the currently executing Maven process, and finally 
change them back. This may have unanticipated side effects if you're 
running Maven in embedded mode and process forking is disabled. 
Embedders should not disable forking during Surefire testing.  [Tests 
themselves might do something even more dangerous, like calling 
System.exit().]"

Switching back to the previous version of the surefire plugin (2.3.1) 
makes my tests work fine again:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>2.3.1</version>
</plugin>

Is this an issue with Mevenide or the new maven-surefire-plugin 2.4?

Many thanks in advance for any insights!

Best regards,

Andreas

-- 
Andreas Loew
Java Architect
Sun Microsystems (Germany)


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

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.