Andy Glick wrote:
I have had success doing the following:

1) add xmlns:artifact="artifact" to the maven.xml file's project tag

2) add the following preGoal code:

  <preGoal name="test:test">
    <echo message="test:test preGoal"/>
    <!-- -->
    <maven:set plugin="maven.test.plugin" property="maven.test.skip"
      value="true"/>
    <!-- -->
  </preGoal>


I found that if the maven:set was commented out the tests ran, and when it was not, the tests did not run. I think that is what you want, yes?

Hope that this helps.

Sorry, I think that I wasn't clear about which maven.xml file. When I have set 
the command line property -Dmaven.test.skip=true, then the testing phase never 
executes any tests in any subproject.

The example that I gave was to be applied per maven.xml file in each directory 
where you want to allow test execution to be turned off. You might want to 
think about adding a test for a property that you could set on the command 
line, which, if set, could cause the maven.test.skip property to be set to true.

From my understanding, each time the test plugin is instantiated in a maven.xml 
file which executes its tests under normal conditions, you must explicitly set 
the variable maven.test.skip as the plugin is initialized. This is a Jelly 
issue, apparently the window of opportunity for setting plugin variables 
explicitly is quite small, which is why I used a preGoal on the test plugin to 
accomplish it.

see [http://jira.codehaus.org/browse/MAVEN-1656] for Brett's explanation about 
setting Maven plugin variables.

Again, this worked under M1.1b1, under M1.1b2 your mileage may vary.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to