MPTEST-66: document backward-compat problem.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@534217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
& <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>
|
||||
|
||||
Reference in New Issue
Block a user