This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE 6.7 (Build 200906241340) Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16 System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb) Userdir: C:\Documents and Settings\Uli\.netbeans\6.7 --- Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100) Java version: 1.6.0_14 Java home: C:\Program Files\Java\jdk1.6.0_14\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows" --- I have two issues with the Netbeans 6.7 maven support that were not present in Netbeans 6.5: 1) If I run a test class (test class is open in editor, choosing Run-Run File from menu) in Netbeans 6.7 the following is executed: NetBeans: Executing '"C:\Program Files\apache-maven-2.1.0\bin\mvn.bat" -Dmaven.test.skip=true -Dexec.classpathScope=test -Dexec.args=-classpath %classpath org.xxx.xxx.xx.xxxxx.ArticleXMLTest -Dexec.executable=C:\Program Files\Java\jdk1.6.0_14\bin\java.exe -Dnetbeans.execution=true --errors --errors --fail-fast process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec' In Netbeans 6.5 the following was executed: NetBeans: Executing 'C:\Program Files\apache-maven-2.1.0\bin\mvn.bat -Dtest=ArticleXMLTest --errors test-compile surefire:test' I am not quite sure if this has anything to do with the second issue (see below) but it doesn't seem right to my to launch a test class calling the exec plugin instead of the surefire plugin. 2) The more serious issue is that I have defined a lot of system properties in the pom, more specifically in the context of the exec-maven-plugin and the maven-surefire-plugin that are required to run my classes (database connection etc.): <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <redirectTestOutputToFile>true</redirectTestOutputToFile> <argLine>-Xmx1024m -Xms128m</argLine> <includes> <include>**/*Test.java</include> </includes> <forkMode>always</forkMode> <systemProperties> <property> <name>testproperty</name> <value>testvalue</value> </property> </systemProperties> </configuration> </plugin> However, if I run a class from the source or the test tree I cannot access these properties. The following returns 'null' if executed in Netbeans 6.7: String value = System.getProperty(key); This works in Netbeans 6.5 and when calling maven from the command line.
1. In 6.7 you should use the "Test file" action for testing, rather than "Run file" (which executes main class), the Test file action is missing in editor's popup (issue 167267). 2. Is the test executed via the quick runner/compile on save? you would notice by having non-maven output in the output window when running the test. If so, can you try turning Compile on Save off (in project properties window) and retry?
Okay, compile on save option definitely plays a role here, at least for test classes (see point 3): 1. Compile on save: test execution only I run the test class using 'Test File' and for about one minute (!) nothing at all happens. Then, the Test Results window pops up and the test is executed. System properties defined in the pom.xml as described in the description do not work. 2. Compile on save: disabled I run the test class using 'Test File', the Test Results window immediately pops up and the test is executed. System properties defined in the pom.xml do work. 3. Compile on save: disabled I run a class with a main method (no test class, lives in source tree not in the test tree of the project) using 'Run File'. System properties defined in the pom.xml do not work. Thanks for the quick reply!
re 1. the long delay probably means the build/run was executing in the output window that was hidden. the issue described here is a duplicate of #168036. re 3. probably a problem in exec-maven-plugin, or your configuration of the plugin. Not really netbeans related it seems. closing as duplicate of #168036. *** This issue has been marked as a duplicate of 168036 ***