Skip to content

Commit

Permalink
eclipse-tycho#166: fix false detection of 'clean-only' builds
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.

Change-Id: I68b7abf61835665a648a0bc006153c4631b56ff8
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
  • Loading branch information
HannesWell committed Jul 9, 2021
1 parent 14c648c commit 1c4f66e
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 1c4f66e

Please sign in to comment.