Repository: quarkusio/quarkus
Issue: Maven Devmode in Quarkus 1.10.0 not working when maven-toolchains-plugin is configured

**Describe the bug**
When migrating from Quarkus 1.9.2.Final to 1.10.0.Final launching our maven projects (which have the [maven-toolchains-plugin](https://maven.apache.org/plugins/maven-toolchains-plugin/) configured) in dev mode fails.

**Expected behavior**
Executing `mvn quarkus:dev` should not fail to launch the application with Quarkus 1.10.0.Final

**Actual behavior**
Executing `mvn quarkus:dev` with Quarkus 1.10.0.Final
 results in:
```
C:\\>mvn quarkus:dev
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:test >--------------------------
[INFO] Building test 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:1.10.0.Final:dev (default-cli) @ test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.387 s
[INFO] Finished at: 2020-11-25T20:56:53+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.10.0.Final:dev (default-cli) on project test: Unable to execute mojo: The parameters 'toolchains' for goal org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain are missing or invalid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
```

**To Reproduce**

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).](url)

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:
1. create a ~/.m2/toolchains.xml file containing
   ```xml
	<?xml version="1.0" encoding="ISO-8859-1"?>
	<toolchains>
		<toolchain>
			<type>jdk</type>
			<provides>
				<version>11</version>
				<vendor>openjdk</vendor>
			</provides>
			<configuration>
				<jdkHome>/path/to/java11</jdkHome>
			</configuration>
		</toolchain>
	</toolchains>
   ```
1. unzip the [test-project.zip](https://github.com/quarkusio/quarkus/files/5599063/test-project.zip)
1. run `mvn quarkus:dev` in the project folder

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: Microsoft Windows [Version 10.0.18363.1139]
 - Output of `java -version`: openjdk version "11.0.9.1" 2020-11-04 LTS
 - GraalVM version (if different from Java): 
 - Quarkus version or git rev: Quarkus 1.10.0.Final
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

**Additional context**
The issue might be introduced via https://github.com/quarkusio/quarkus/pull/12973


Changed files:
devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java

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 045924bd007..d39e7899552 100644
--- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
+++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java
@@ -35,6 +35,7 @@
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginExecution;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.BuildPluginManager;
@@ -419,24 +420,39 @@ private void executeIfConfigured(String pluginGroupId, String pluginArtifactId,
                         version(plugin.getVersion()),
                         plugin.getDependencies()),
                 goal(goal),
-                getPluginConfig(plugin),
+                getPluginConfig(plugin, goal),
                 executionEnvironment(
                         project,
                         session,
                         pluginManager));
     }
 
-    private Xpp3Dom getPluginConfig(Plugin plugin) {
-        Xpp3Dom configuration = configuration();
-        Xpp3Dom pluginConfiguration = (Xpp3Dom) plugin.getConfiguration();
-        if (pluginConfiguration != null) {
-            //Filter out `test*` configurations
-            for (Xpp3Dom child : pluginConfiguration.getChildren()) {
+    private Xpp3Dom getPluginConfig(Plugin plugin, String goal) {
+        Xpp3Dom mergedConfig = null;
+        if (!plugin.getExecutions().isEmpty()) {
+            for (PluginExecution exec : plugin.getExecutions()) {
+                if (exec.getConfiguration() != null && exec.getGoals().contains(goal)) {
+                    mergedConfig = mergedConfig == null ? (Xpp3Dom) exec.getConfiguration()
+                            : Xpp3Dom.mergeXpp3Dom(mergedConfig, (Xpp3Dom) exec.getConfiguration(), true);
+                }
+            }
+        }
+
+        if ((Xpp3Dom) plugin.getConfiguration() != null) {
+            mergedConfig = mergedConfig == null ? (Xpp3Dom) plugin.getConfiguration()
+                    : Xpp3Dom.mergeXpp3Dom(mergedConfig, (Xpp3Dom) plugin.getConfiguration(), true);
+        }
+
+        final Xpp3Dom configuration = configuration();
+        if (mergedConfig != null) {
+            // Filter out `test*` configurations
+            for (Xpp3Dom child : mergedConfig.getChildren()) {
                 if (!child.getName().startsWith("test")) {
                     configuration.addChild(child);
                 }
             }
         }
+
         return configuration;
     }