|
|
|
[
Permlink
| « Hide
]
Milos Kleint - 15/Oct/06 12:06 PM
postpone, needs changes in maven embedder binaries.
when talking to jason, I understood that expressions defined in the parameters shall have priority over what's in the pom. The solution then would be to read the value in pom, enhance it and use as -D<key>=<value> on the command line
A workaround for the issue:
Assuming your surefire setup is like this and your tests need the foobar property set in order to pass. <project> .... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.3</version> <configuration> <argLine>-Dfoobar=YES</argLine> </configuration> </plugin> </plugins> </build> </project> 1. Add a profile to the pom.xml with the following <profiles> section <profiles> <profile> <id>debug</id> <activation> <property> <name>debug</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.3</version> <configuration> <argLine>-Dfoobar=YES ${argLine}</argLine> </configuration> </plugin> </plugins> </build> </profile> </profiles> 2. Then go to the project's Properties dialog and in the Actions panel, find the "Debug Test" action mapping and add "debug=true" to the list of properties already present. Then invoking the "Debug file" action on the test class should run the test and stop at breakpoints correctly. It will not in 6.0 betas when using the command-line maven instance for building (issue http://www.netbeans.org/issues/show_bug.cgi?id=119866 The only downside to the workaround is that you have the foobar property setup at 2 distinct places. If you don't want to include the profile in the pom.xml file, placing it into ${basedir}/profiles.xml shall work in the same manner. profiles.xml is not shareable by default, so might be a better location. in surefire plugin 2.4 there's a new property ${maven.surefire.debug} which is used to pass debugging params into the forked jvm. These are added to the arg parameter.
We are seeing the same problem. We are using 2.4.3 surefire plugin and it does not seem to help.
Suggested solution, having an 'externalArgLine' readOnly property which also defaults to ${argLine}, and an 'inheritArgLine' boolean defaulting to true. If user sets 'argLine', it will be appended to 'externalArgLine' if 'inheritArgLine' is true. The inherit can of course be turned off if desirable. See attached suggested implementation. Not sure if it is the ultimate solution, but at least it worked for me, and gives the user of the plugin the possibility to decide what argLine to use
|
|||||||||||||||||||||||||||||||||||||||||||||||||