Skip to content

Commit

Permalink
#179 Fix false detection of 'clean-only' builds (regression from #166)
Browse files Browse the repository at this point in the history
If default goals are used Maven can be invoked without specifying goals
explicitly in the command, so the List of goals is empty.

This had the consequence, that the AbstractMavenLifecycleParticipant
false detected a clean-only build and skipped dependency/target-platform
resolution, which lead to follow up errors.

The logic to detect 'clean-only' builds is improved to consider the
described case.
  • Loading branch information
HannesWell authored and mickaelistria committed Jul 9, 2021
1 parent 14c648c commit ac30b1f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -240,7 +240,8 @@ private boolean disableLifecycleParticipation(MavenSession session) {
// command line property to disable Tycho lifecycle participant
return "maven".equals(session.getUserProperties().get("tycho.mode"))
|| session.getUserProperties().containsKey("m2e.version")
|| CLEAN_PHASES.containsAll(session.getGoals());
// disable for 'clean-only' builds. Consider that Maven can be invoked without explicit goals, if default goals are specified
|| (!session.getGoals().isEmpty() && CLEAN_PHASES.containsAll(session.getGoals()));
}

private void configureComponents(MavenSession session) {
Expand Down

0 comments on commit ac30b1f

Please sign in to comment.