Hi,
Many thanks for your help. It is very appreciated. However, tried the code
you suggest and it is still not working. Using the print statement:
<ant:echo>(1) maven.disable.tests =
${context.getVariable('maven.disable.tests')}</ant:echo>
in the code (which is in a common maven.xml file):
<preGoal name="test:test">
<j:choose>
<j:when test="${context.getVariable('maven.disable.tests') ==
'true'}">
<ant:echo>(1) maven.disable.tests =
${context.getVariable('maven.disable.tests')}</ant:echo>
<maven:set plugin="maven-test-plugin"
property="maven.test.skip" value="true" />
</j:when>
<j:otherwise>
<ant:echo>(2) maven.disable.tests =
${context.getVariable('maven.disable.tests')}</ant:echo>
</j:otherwise>
</j:choose>
</preGoal>
The varaiable maven.disable.tests appears to be empty when running the goal
multi:all, however, shouldn't be due to code in the buildsystem maven.xml,
where the goal is executed from:
<goal name="multi:all">
<!-- Only runs the tests while building the site -->
<attainGoal name="clean"/>
<j:set var="maven.disable.tests" value="true" />
<attainGoal name="multi:build" />
<j:set var="maven.disable.tests" value="false" />
<attainGoal name="multi:site" />
</goal>
Tried changing the <j:set var="maven.disable.tests" value="true" />
statement to ${context.setVariable('maven.disable.tests','true')} etc. with
no luck.
Does anybody have any suggestions?
Thanks
Mike
I finally worked out some Jelly code that I believe addresses your
requirements using m1.1b2:
1) my earlier remarks about the artifact plugin's namespace can be ignored,
it isn't required
2) in your multiproject context, if you add the preGoal logic to the top
level maven.xml file it will be inherited by the subprojects, so it is
required only once
3) the behavior varies based on the value of the Maven variable
maven.disable.tests, which you can set programatically as needed
4) the echo statements were included to produce warm fuzzies
<preGoal name="test:test">
<j:choose>
<j:when test="${context.getVariable('maven.disable.tests') == 'true'}">
<echo message="in test:test preGoal maven.disable.tests == true"/>
<maven:set plugin="maven-test-plugin" property="maven.test.skip"
value="true"/>
</j:when>
<j:otherwise>
<echo message="in test:test preGoal maven.disable.tests != true"/>
</j:otherwise>
</j:choose>
</preGoal>
So your code could be modified as follows:
<goal name="multi:all">
<!-- Only runs the tests while building the site -->
<attainGoal name="clean"/>
<j:set var="maven.disable.tests" value="true" />
<attainGoal name="multi:build" />
<j:set var="maven.disable.tests" value="false" />
<attainGoal name="multi:site" />
</goal>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]