Skip to content

Commit

Permalink
eclipse-tycho#179 Fix false detection of 'clean-only' builds (regress…
Browse files Browse the repository at this point in the history
…ion from eclipse-tycho#166)

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 committed Jul 9, 2021
1 parent 14c648c commit 3544445
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 3544445

Please sign in to comment.