From 1c4f66e9cb9f25583f3fd260e492620dcf18198c Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 9 Jul 2021 17:17:16 +0200 Subject: [PATCH] #166: fix false detection of 'clean-only' builds 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 --- .../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) {