It seems we have weird problems with variables scope in m1.1 your problem is certainly a side-effect of this issue : http://jira.codehaus.org/browse/MAVEN-1691
It's a workaround you can use, waiting for a fix, but it's very dangerous to use the parent scope. You must check if it doesn't create another side-effect Arnaud On 9/19/05, Michael Owen <[EMAIL PROTECTED]> wrote: > > > > I've solved the problem. The multiproject goal needed changing to: > > <goal name="multi:all"> > > <!-- Only runs the tests while building the site --> > <attainGoal name="clean"/> > > <j:set var="maven.disable.tests" value="true" scope="parent" /> > > <attainGoal name="multi:build" /> > > <j:set var="maven.disable.tests" value="false" scope="parent" /> > > <attainGoal name="multi:site" /> > > </goal> > > i.e. scope="parent" added. > > > > > <BLOCKQUOTE style='PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: > #A0C6E5 > 2px solid; MARGIN-RIGHT: 0px'><font > style='FONT-SIZE:11px;FONT-FAMILY:tahoma,sans-serif'><hr color=#A0C6E5 > size=1> > From: <i>"Michael Owen" > <[EMAIL PROTECTED]></i><br>Reply-To: <i>"Maven Users > List" <[email protected]></i><br>To: > <i>[email protected]</i><br>Subject: <i>Re: [m1.1b2] maven.test.skip > not working</i><br>Date: <i>Mon, 19 Sep 2005 10:03:09 > +0100</i><br>>Hi,<br>><br>>Many thanks for your help. It is very > appreciated. However, tried <br>>the code you suggest and it is still not > working. Using the print > <br>>statement:<br>><br>><ant:echo>(1) maven.disable.tests = > <br>>${context.getVariable('maven.disable.tests')}</ant:echo><br>><br>>in > the code (which is in a common maven.xml file):<br>><br>> > <preGoal name="test:test"><br>><br>> > <j:choose><br>> <j:when > <br>>test="${context.getVariable('maven.disable.tests') == > 'true'}"><br>> <ant:echo>(1) > maven.disable.tests = > <br>>${context.getVariable('maven.disable.tests')}</ant:echo><br>> > <maven:set plugin="maven-test-plugin" > <br>>property="maven.test.skip" value="true" > /><br>> </j:when><br>><br>> > <j:otherwise><br>> <ant:echo>(2) > maven.disable.tests = > <br>>${context.getVariable('maven.disable.tests')}</ant:echo><br>> > </j:otherwise><br>> > </j:choose><br>><br>> </preGoal><br>><br>>The > varaiable maven.disable.tests appears to be empty when running <br>>the > goal multi:all, however, shouldn't be due to code in the <br>>buildsystem > maven.xml, where the goal is executed from:<br>><br>> <goal > name="multi:all"><br>><br>> <!-- Only runs the > tests while building the site --><br>> <attainGoal > name="clean"/><br>><br>> <j:set > var="maven.disable.tests" value="true" > /><br>><br>> <attainGoal name="multi:build" > /><br>><br>> <j:set var="maven.disable.tests" > value="false" /><br>><br>> <attainGoal > name="multi:site" /><br>><br>> > </goal><br>><br>>Tried changing the <j:set > var="maven.disable.tests" value="true" /> > <br>>statement to ${context.setVariable('maven.disable.tests','true')} > <br>>etc. with no luck.<br>><br>>Does anybody have any > suggestions?<br>><br>>Thanks<br>><br>>Mike<br>><br>><br>><br>><br>>I > finally worked out some Jelly code that I believe addresses your > <br>>requirements using m1.1b2:<br>><br>>1) my earlier remarks > about the artifact plugin's namespace can be <br>>ignored, it isn't > required<br>><br>>2) in your multiproject context, if you add the > preGoal logic to the <br>>top level maven.xml file it will be inherited > by the subprojects, so <br>>it is required only once<br>><br>>3) > the behavior varies based on the value of the Maven variable > <br>>maven.disable.tests, which you can set programatically as > needed<br>><br>>4) the echo statements were included to produce warm > fuzzies<br>><br>><preGoal name="test:test"><br>> > <j:choose><br>> <j:when > test="${context.getVariable('maven.disable.tests') == > <br>>'true'}"><br>> <echo message="in test:test > preGoal maven.disable.tests == <br>>true"/><br>> > <maven:set plugin="maven-test-plugin" > <br>>property="maven.test.skip"<br>> > value="true"/><br>> </j:when><br>> > <j:otherwise><br>> <echo message="in test:test > preGoal maven.disable.tests != <br>>true"/><br>> > </j:otherwise><br>> > </j:choose><br>></preGoal><br>><br>>So your code could > be modified as follows:<br>><br>><goal > name="multi:all"><br>><br>> <!-- Only runs the > tests while building the site --><br>> <attainGoal > name="clean"/><br>><br>> <j:set > var="maven.disable.tests" value="true" /><br>> > <attainGoal name="multi:build" /><br>><br>> > <j:set var="maven.disable.tests" value="false" > /><br>><br>> <attainGoal name="multi:site" > > /><br>><br>></goal><br>><br>><br>>---------------------------------------------------------------------<br>>To > unsubscribe, e-mail: [EMAIL PROTECTED]<br>>For > additional commands, e-mail: > [EMAIL PROTECTED] > <br>><br>><br>><br>>---------------------------------------------------------------------<br>>To > unsubscribe, e-mail: [EMAIL PROTECTED]<br>>For > additional commands, e-mail: > [EMAIL PROTECTED]<br>><br></font></BLOCKQUOTE> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
