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



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

Reply via email to