Author: ltheussl
Date: Tue May  1 12:56:05 2007
New Revision: 534217

URL: http://svn.apache.org/viewvc?view=rev&rev=534217
Log:
MPTEST-66: document backward-compat problem.

Modified:
    maven/maven-1/plugins/trunk/test/xdocs/changes.xml
    maven/maven-1/plugins/trunk/test/xdocs/index.xml

Modified: maven/maven-1/plugins/trunk/test/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/test/xdocs/changes.xml?view=diff&rev=534217&r1=534216&r2=534217
==============================================================================
--- maven/maven-1/plugins/trunk/test/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/test/xdocs/changes.xml Tue May  1 12:56:05 2007
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="1.8.1-SNAPSHOT" date="In SVN">
+      <action dev="ltheussl" type="update" issue="MPTEST-66">Document a 
backward-compat problem affecting version 1.8 of the plugin.</action>
       <action dev="ltheussl" type="add" issue="MPTEST-71">New property to halt 
a build on test failures but after all tests have been run.</action>
       <action dev="ltheussl" type="add" due-to="Nicolas de Loof" 
issue="MPTEST-69">New properties to configure compiler for test 
classes.</action>
       <action dev="ltheussl" type="fix" due-to="Dennis Lundberg" 
issue="MPTEST-68">SourceModifications sometimes does not work for test 
classes.</action>

Modified: maven/maven-1/plugins/trunk/test/xdocs/index.xml
URL: 
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/test/xdocs/index.xml?view=diff&rev=534217&r1=534216&r2=534217
==============================================================================
--- maven/maven-1/plugins/trunk/test/xdocs/index.xml (original)
+++ maven/maven-1/plugins/trunk/test/xdocs/index.xml Tue May  1 12:56:05 2007
@@ -40,5 +40,47 @@
         <li>maven-jar-plugin 1.8 (at least)</li>
       </ul>
     </section>
+    <section name="Backward compatibility issue with version 1.8">
+      <p>
+        Version 1.8 of the test plugin removed a prereq on 
<code>java:compile</code>
+        &amp; <code>java:jar-resources</code> from the <code>test:test</code> 
goal
+        for optimization reasons (see <a 
href="http://jira.codehaus.org/browse/MPTEST-46";>MPTEST-46</a>).
+        This introduced a backward compatibility issue
+        (see <a href="http://jira.codehaus.org/browse/MPTEST-66";>MPTEST-66</a>)
+        which might affect you if the following conditions are met:
+      </p>
+      <ul>
+        <li>
+          You either use <code>maven.test.skip=true</code> or your project has 
no unit tests.
+        </li>
+        <li>
+          Either your project, or a plugin that you use, relies on java 
sources to be compiled
+          by calling the <code>test:test</code> goal.
+        </li>
+      </ul>
+      <p>
+        An illustration of the problem is provided by the
+        <a 
href="http://maven-plugins.sourceforge.net/maven-javaapp-plugin/index.html";>javaapp</a>
+        sourceforge plugin, whose <code>javaapp:jar</code> goal has a prereq 
on <code>test:test</code>,
+        relying on the java sources to be compiled by this call. If you are 
calling this goal now with
+        a project that has no tests, the build will fail.
+      </p>
+      <p>
+        The problem should really be fixed in the corresponding plugin,
+        but a simple workaround is to add the missing goals as a preGoal
+        in your maven.xml:
+      </p>
+      <source><![CDATA[<preGoal name="javaapp:jar">
+  <j:if test="${unitTestSourcesPresent != 'true' or 
context.getVariable('maven.test.skip') == 'true'}">
+    <attainGoal name="java:compile"/>
+    <attainGoal name="java:jar-resources"/>
+  </j:if>
+</preGoal>]]></source>
+      <p>
+        If you don't know the goal that is causing the trouble, you may add
+        the preGoal to <code>test:test</code>, but this might lead
+        to double compilation.
+      </p>
+    </section>
  </body>
 </document>


Reply via email to