|
It seems more logical to fix this in the war plugin. There is a slight backwards compatibility problem, but it only affects the case when test.skip=true, which is not recommended anyway (certainly not in production builds!). Please reconsider this issue as not only the WAR plugin get's broken. + The JAR plugin will compile the java source two times (beacuse prereqs="java:compile,java:jar-resources,test:test") + The javaapp plugin (from maven-plugins@sourceforge.net) doesn't compile java if skip=true + maybe other external plugins expect test:test to compile sources, based on copy/paste of code from official maven plugins, so upgrading to maven-test-plugin 1.8 can break the build process. Why not simply adding moving prerequs on java:compile to test:test ? <goal name="test:test" This issue was intoduced from the fix of I like nicolas' solution for backward compatability, but I'm not sure if it is "right" to assume that test:test will always compile and copy resources. If other plugins need the java:compile and java:jar-resouces to be run, I think it should explicitly state that, like the JAR plugin example given. (Having said that, I don't like the idea of compiling twice, either...) Actually, it's going to compile twice anyways (unless we revert the whole java:compile and java:jar-resources will do nothing on the second time, so the only impact would be if pre/postGoal's were set in maven.xml. Lot's of code generation plugin are attached to java:compile as preGoals... I can suggest two options : 1. keep previous behaviour and assume test:* allways depends on java:compile, even if this is not clean. 2. make ONLY the "test" goal (not the "test:test") depend on java:compile, so that a
Any 3d solution would be welcome as both seems not very cool... Not clear how the whole prereqs stuff work, but I was wondering if adding an attribute to call attainGoal with the same werkz session would work. Something like <attainGoal name="java:compile" useParentSession="true" />. We need to decide what to do about this issue for m11. Personally, I don't want to revert <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> Sources being compiled twice is not a real problem (and btw it was that way before already), as the second time only the goal will be called but the sources not actually compiled. So my suggestion is to leave it as is and write a paragraph on the main plugin page to document the problem. Unless someone comes up with a new solution, as none of the alternatives above seem acceptable to me. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Patch to attach java:compile as a test:test prereqs
this patch also solves
MPWAR-62