Maven 1.x Test Plugin

test:test goal results in double invocation of java:compile goal

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.8.2
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    All environments
  • Number of attachments :
    0

Description

The test:test goal has been modified to conditionally invoke test:compile via attainGoal(test:compile). This was previously done with the prereqs attribute. Doing so caused the java:compile and all pre/post goals associated to fire twice. You can witness this behaviour even when compiling MAven 1.1 from source.

It seems unnecessary to do this for the test:test goal which conditionally skips the tests when test:compile also conditionally skips compiling. Making the same operation for test:single which intentionally omits the check for maven.test.skip makes a lot of sense.

Issue Links

Activity

Hide
Lukas Theussl added a comment -

Did you read MPTEST-66? If we can come up with a general solution, without spoiling MPTEST-46, ... well, patches would be warmly welcomed.

Show
Lukas Theussl added a comment - Did you read MPTEST-66? If we can come up with a general solution, without spoiling MPTEST-46, ... well, patches would be warmly welcomed.
Hide
Alex Volanis added a comment -

I read MPTEST-66 5 minutes after I submitted the report

I patched the plugin to restore the previous behavior in our build environment since it was causing quite a bit of upset users having lengthy java:compile preGoals taking too much time in their builds. We have some expensive java:compile preGoals firing for every project in a mutlicomponent environment which is causing a lot of wasted time.

If the attainGoal allowed for session propagation this would have never been an issue. Why doesn't it? I am considering a patch to control this behavior globally and by tag attribute.

Show
Alex Volanis added a comment - I read MPTEST-66 5 minutes after I submitted the report I patched the plugin to restore the previous behavior in our build environment since it was causing quite a bit of upset users having lengthy java:compile preGoals taking too much time in their builds. We have some expensive java:compile preGoals firing for every project in a mutlicomponent environment which is causing a lot of wasted time. If the attainGoal allowed for session propagation this would have never been an issue. Why doesn't it? I am considering a patch to control this behavior globally and by tag attribute.
Hide
Lukas Theussl added a comment -

attainGoal not using the global session is a very old bug: MAVEN-256. We probably should have fixed that for Maven 1.1...

Show
Lukas Theussl added a comment - attainGoal not using the global session is a very old bug: MAVEN-256. We probably should have fixed that for Maven 1.1...

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: