From ec5bccf43cfa301bc828fcf5cac5f8eff74fb002 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Fri, 14 Feb 2020 12:47:07 -0300 Subject: [PATCH] Remove test-related entries in maven-compiler-plugin Some properties (like `testSource` and `testTarget`) are valid only for the `testCompile` mojo, however they are allowed to be declared as part of the maven-compiler-plugin configuration Co-authored-by: Justin Lee --- .../src/main/java/io/quarkus/maven/DevMojo.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java index 44ac9bfa6..089d4fcf2 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java @@ -370,9 +370,15 @@ public class DevMojo extends AbstractMojo { } private void executeCompileGoal(Plugin plugin, String groupId, String artifactId) throws MojoExecutionException { - Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration(); - if (configuration == null) { - configuration = MojoExecutor.configuration(); + Xpp3Dom configuration = MojoExecutor.configuration(); + Xpp3Dom pluginConfiguration = (Xpp3Dom) plugin.getConfiguration(); + if (pluginConfiguration != null) { + //Filter out `test*` configurations + for (Xpp3Dom child : pluginConfiguration.getChildren()) { + if (!child.getName().startsWith("test")) { + configuration.addChild(child); + } + } } MojoExecutor.executeMojo( MojoExecutor.plugin(