From ac30b1f483a2d7c8f8684c4d487a8f078ec4d66e Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 9 Jul 2021 17:17:16 +0200 Subject: [PATCH] #179 Fix false detection of 'clean-only' builds (regression from #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. --- .../tycho/core/maven/TychoMavenLifecycleParticipant.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java index e233fbed8a..6a877cd0b1 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java @@ -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) {