This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new a85dd49cb3 fix: force reactor plugin projects to reach READY 
regardless of requested phase (#13559)
a85dd49cb3 is described below

commit a85dd49cb377aca7cbcca0dae071fe07b816e3b6
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Nov 12 08:22:06 2026 +0100

    fix: force reactor plugin projects to reach READY regardless of requested 
phase (#13559)
    
    When the concurrent builder detects that a project uses a plugin that is
    also a reactor module, it now un-skips the plugin project's READY phase
    and all its transitive predecessor steps (including cross-project
    dependencies such as reactor libraries the plugin compiles against).
    
    Previously, requesting a phase before "compile" (e.g. "initialize") left
    the plugin project's READY step skipped, so the plugin JAR was never
    built and resolution failed. When the plugin project itself depended on
    another reactor library, that library's steps were also left skipped,
    causing the plugin's compilation to fail even after the first fix.
    
    Re-enables the MNG-1088 integration test with `mvn initialize -b
    concurrent`, preserving the original test's intent of invoking a phase
    before "compile". Migrates the IT plugin fixture to the Maven 4 API
    (maven-api-core + maven-api-di, implements Mojo) to avoid classloading
    issues when the plugin is loaded from target/classes/.
    
    Extracts the skip-clearing logic into a package-private
    applyReactorPluginConstraints(BuildPlan) method on BuildContext to allow
    direct unit testing. Adds two unit tests: one for the two-project case
    (plugin + consumer) and one for the three-project case (library + plugin
    + consumer).
    
    Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
 .../internal/concurrent/BuildPlanExecutor.java     |  55 +++++++-
 .../internal/concurrent/BuildPlanCreatorTest.java  | 156 +++++++++++++++++++++
 .../MavenITmng1088ReactorPluginResolutionTest.java |  19 +--
 .../src/test/resources/mng-1088/client/pom.xml     |  10 +-
 .../src/test/resources/mng-1088/plugin/pom.xml     |  20 +--
 .../org/apache/maven/plugin/coreit/TouchMojo.java  |  65 ++++-----
 .../src/test/resources/mng-1088/pom.xml            |  16 +--
 7 files changed, 268 insertions(+), 73 deletions(-)

diff --git 
a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
 
b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
index 054d67c6ce..36881a7bde 100644
--- 
a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
+++ 
b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
@@ -363,19 +363,66 @@ public BuildPlan buildInitialPlan(List<TaskSegment> 
taskSegments) {
             // Handle reactor plugins: if a project uses a plugin that is also 
a reactor module,
             // the project's PLAN step must wait for the plugin project's 
READY step.
             // This must be done after PLAN/READY steps are created above.
+            applyReactorPluginConstraints(plan);
+
+            return plan;
+        }
+
+        /**
+         * Applies reactor-plugin ordering and skip-clearing constraints to a 
plan.
+         * <p>
+         * For each project that uses a plugin which is itself a reactor 
module, this method:
+         * <ol>
+         *   <li>Makes the consumer project's PLAN step wait for the plugin 
project's READY step.</li>
+         *   <li>Clears the {@code skip} flag on the plugin project's READY 
step and its
+         *       transitive predecessors that were actually skipped (i.e. 
beyond the requested
+         *       phase) — including cross-project predecessors such as reactor 
libraries that the
+         *       plugin project depends on — so that the entire dependency 
chain is built to the
+         *       point where the plugin is READY, even when the requested 
phase would otherwise
+         *       stop before READY (e.g. {@code initialize}).  Steps that are 
already not skipped
+         *       (structural steps like SETUP/PLAN and phases within the 
requested phase) are left
+         *       untouched, avoiding unnecessary empty-shell executions.</li>
+         * </ol>
+         * <p>
+         * This method is package-private so that unit tests can exercise the 
logic independently
+         * of the full {@link #buildInitialPlan} setup (which requires a live 
{@code MavenSession}).
+         * Callers must ensure that PLAN steps for consumer projects and 
lifecycle steps (including
+         * READY) for plugin projects have already been added to the plan 
before calling this method.
+         *
+         * @param plan the build plan to mutate; must already contain PLAN 
steps for every project
+         */
+        void applyReactorPluginConstraints(BuildPlan plan) {
             Map<String, MavenProject> reactorGavs =
                     
plan.getAllProjects().keySet().stream().collect(Collectors.toMap(BuildPlanExecutor::gav,
 p -> p));
             for (MavenProject project : plan.getAllProjects().keySet()) {
                 for (Plugin plugin : project.getBuild().getPlugins()) {
                     MavenProject pluginProject = reactorGavs.get(gav(plugin));
                     if (pluginProject != null && pluginProject != project) {
-                        plan.step(project, PLAN)
-                                .ifPresent(pp -> plan.step(pluginProject, 
READY).ifPresent(pp::executeAfter));
+                        plan.step(project, PLAN).ifPresent(pp -> {
+                            plan.step(pluginProject, 
READY).ifPresent(readyStep -> {
+                                pp.executeAfter(readyStep);
+                                // Force the plugin project — and any reactor 
libraries it
+                                // transitively depends on — to reach READY 
even if the
+                                // requested phase is earlier (e.g. 
initialize). Without this,
+                                // a reactor library that the plugin compiles 
against would
+                                // remain skipped, causing the plugin's 
compilation to fail.
+                                //
+                                // Only un-skip steps that were actually 
skipped (i.e. beyond
+                                // the requested phase).  Steps within the 
requested phase
+                                // already have skip=false and don't need to 
be touched.
+                                // Leaving already-unskipped structural steps 
(SETUP, PLAN,
+                                // before:/after: nodes within the requested 
phase) untouched
+                                // avoids empty-shell executions that would 
otherwise trigger
+                                // misleading SETUP/TEARDOWN lifecycle events.
+                                readyStep
+                                        .allPredecessors()
+                                        .filter(s -> s.skip.get())
+                                        .forEach(s -> s.skip.set(false));
+                            });
+                        });
                     }
                 }
             }
-
-            return plan;
         }
 
         private void checkUnboundVersions(BuildPlan buildPlan) {
diff --git 
a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java
 
b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java
index afb920ae7c..7bdf53f76a 100644
--- 
a/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java
+++ 
b/impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java
@@ -20,6 +20,7 @@
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Consumer;
@@ -467,4 +468,159 @@ protected void mojo(Consumer<String> writer, 
MojoExecution mojoExecution) {}
                     pred -> assertTrue(plan.step(pred.project, 
pred.name).isPresent(), "Phase not present: " + pred));
         });
     }
+
+    /**
+     * Verifies that when the requested phase is before "compile" (e.g. 
"initialize"),
+     * the new skip-clearing logic forces the reactor plugin project and all 
its
+     * predecessors to reach READY so that the plugin is available when needed.
+     */
+    @Test
+    void testReactorPluginPreCompilePhase() {
+        MavenProject p1 = new MavenProject();
+        p1.setGroupId("g");
+        p1.setArtifactId("p1");
+        p1.setVersion("1.0");
+        p1.setCollectedProjects(List.of());
+        Plugin plugin = new Plugin();
+        plugin.setGroupId("g");
+        plugin.setArtifactId("p2");
+        plugin.setVersion("1.0");
+        p1.getBuild().addPlugin(plugin);
+
+        MavenProject p2 = new MavenProject();
+        p2.setGroupId("g");
+        p2.setArtifactId("p2");
+        p2.setVersion("1.0");
+        p2.setCollectedProjects(List.of());
+
+        Map<MavenProject, List<MavenProject>> projects = new HashMap<>();
+        projects.put(p2, Collections.emptyList());
+        projects.put(p1, Collections.singletonList(p2));
+
+        // Use a phase before "compile" — this is the path that triggers the 
skip-clearing logic.
+        // Without the fix, "ready" (and compile/package/…) would be skipped 
for p2 because
+        // "initialize" ends well before "ready" in the lifecycle.
+        DefaultLifecycleRegistry lifecycles = new 
DefaultLifecycleRegistry(Collections.emptyList());
+        BuildPlanExecutor.BuildContext context =
+                new BuildPlanExecutor(null, null, null, null, null, null, 
null, null, lifecycles).new BuildContext();
+
+        BuildPlan plan = context.calculateLifecycleMappings(projects, 
"initialize");
+
+        // Baseline: without the fix, "ready" on the plugin project IS skipped 
(initialize < ready).
+        assertTrue(
+                plan.requiredStep(p2, "ready").skip.get(),
+                "Baseline: ready step of plugin project should be skipped 
before applyReactorPluginConstraints");
+
+        // Simulate what buildInitialPlan does: add PLAN steps for each 
project so that
+        // applyReactorPluginConstraints can wire the PLAN→READY ordering 
constraint.
+        for (MavenProject project : projects.keySet()) {
+            BuildStep planStep = new BuildStep(BuildStep.PLAN, project, null);
+            planStep.status.set(BuildStep.PLANNING);
+            plan.addStep(project, BuildStep.PLAN, planStep);
+        }
+
+        // Apply the reactor-plugin constraints (the fix under test).
+        context.applyReactorPluginConstraints(plan);
+
+        // After the fix: the READY step of the plugin project (p2) must NOT 
be skipped.
+        assertFalse(
+                plan.requiredStep(p2, "ready").skip.get(),
+                "READY step of the reactor plugin project must not be skipped 
after applyReactorPluginConstraints");
+
+        // All predecessors of "ready" within p2 must also not be skipped — 
they are needed
+        // to reach READY (resources, compile, package, …).
+        plan.requiredStep(p2, "ready")
+                .allPredecessors()
+                .filter(s -> s.project == p2)
+                .forEach(s -> assertFalse(
+                        s.skip.get(), "Predecessor step " + s.name + " of 
plugin project must not be skipped"));
+    }
+
+    /**
+     * Verifies that when the requested phase is before "compile" (e.g. 
"initialize") and the
+     * reactor plugin project itself has a reactor library dependency, the 
skip-clearing logic
+     * also un-skips the library project's steps that are needed to compile 
the plugin.
+     * <p>
+     * Scenario: library (p3) → plugin (p2) → consumer (p1). Without the fix 
the library's
+     * compile steps remain skipped, causing the plugin's compilation to fail 
at READY.
+     */
+    @Test
+    void testReactorPluginWithLibraryDependencyPreCompilePhase() {
+        // p3: reactor library (no special plugins)
+        MavenProject p3 = new MavenProject();
+        p3.setGroupId("g");
+        p3.setArtifactId("p3");
+        p3.setVersion("1.0");
+        p3.setCollectedProjects(List.of());
+
+        // p2: reactor plugin that depends on the library p3
+        MavenProject p2 = new MavenProject();
+        p2.setGroupId("g");
+        p2.setArtifactId("p2");
+        p2.setVersion("1.0");
+        p2.setCollectedProjects(List.of());
+        // p2 declares a compile-scope dependency on p3 (the library) — this 
is what
+        // filterByScope checks when creating cross-project DEPENDENCIES 
ordering edges.
+        p2.getDependencies().add(createDependency("g", "p3", "compile"));
+
+        // p1: consumer that uses the reactor plugin p2
+        MavenProject p1 = new MavenProject();
+        p1.setGroupId("g");
+        p1.setArtifactId("p1");
+        p1.setVersion("1.0");
+        p1.setCollectedProjects(List.of());
+        Plugin plugin = new Plugin();
+        plugin.setGroupId("g");
+        plugin.setArtifactId("p2");
+        plugin.setVersion("1.0");
+        p1.getBuild().addPlugin(plugin);
+
+        // Dependency order: p3 (library) must be built before p2 (plugin), p2 
before p1 (consumer)
+        Map<MavenProject, List<MavenProject>> projects = new LinkedHashMap<>();
+        projects.put(p3, Collections.emptyList());
+        projects.put(p2, Collections.singletonList(p3));
+        projects.put(p1, Collections.singletonList(p2));
+
+        DefaultLifecycleRegistry lifecycles = new 
DefaultLifecycleRegistry(Collections.emptyList());
+        BuildPlanExecutor.BuildContext context =
+                new BuildPlanExecutor(null, null, null, null, null, null, 
null, null, lifecycles).new BuildContext();
+
+        BuildPlan plan = context.calculateLifecycleMappings(projects, 
"initialize");
+
+        // Baseline: "ready" on both the plugin and the library must be 
skipped before the fix.
+        assertTrue(
+                plan.requiredStep(p2, "ready").skip.get(),
+                "Baseline: ready step of plugin project (p2) should be skipped 
before applyReactorPluginConstraints");
+        assertTrue(
+                plan.requiredStep(p3, "ready").skip.get(),
+                "Baseline: ready step of library project (p3) should be 
skipped before applyReactorPluginConstraints");
+
+        // Add PLAN steps as buildInitialPlan would.
+        for (MavenProject project : projects.keySet()) {
+            BuildStep planStep = new BuildStep(BuildStep.PLAN, project, null);
+            planStep.status.set(BuildStep.PLANNING);
+            plan.addStep(project, BuildStep.PLAN, planStep);
+        }
+
+        context.applyReactorPluginConstraints(plan);
+
+        // After the fix: the plugin project (p2) must be un-skipped all the 
way to READY.
+        assertFalse(
+                plan.requiredStep(p2, "ready").skip.get(),
+                "READY step of the reactor plugin project (p2) must not be 
skipped");
+
+        // Also: the library project (p3) that p2 depends on must be 
un-skipped so that p2
+        // can compile against it. This was the gap addressed by removing the 
project filter.
+        assertFalse(
+                plan.requiredStep(p3, "ready").skip.get(),
+                "READY step of the reactor library project (p3) must not be 
skipped — "
+                        + "the plugin (p2) compiles against it and cannot 
reach READY otherwise");
+
+        // All predecessors of p2's "ready" must also be un-skipped.
+        plan.requiredStep(p2, "ready")
+                .allPredecessors()
+                .filter(s -> s.project == p2)
+                .forEach(s -> assertFalse(
+                        s.skip.get(), "Predecessor step " + s.name + " of 
plugin project (p2) must not be skipped"));
+    }
 }
diff --git 
a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java
 
b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java
index 180b08a412..7d34e18818 100644
--- 
a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java
+++ 
b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng1088ReactorPluginResolutionTest.java
@@ -25,29 +25,30 @@
 /**
  * This is a test set for <a 
href="https://issues.apache.org/jira/browse/MNG-1088";>MNG-1088</a>.
  *
- * @author Brett Porter
+ * <p>Verifies that the concurrent builder automatically builds a reactor 
plugin project up to
+ * the READY phase when another project in the reactor uses that plugin, even 
if the user
+ * requested a phase before "compile" (e.g. "initialize").
  *
+ * @author Brett Porter
  */
-public class MavenITmng1088ReactorPluginResolutionTest extends 
AbstractMavenIntegrationTestCase {
+class MavenITmng1088ReactorPluginResolutionTest extends 
AbstractMavenIntegrationTestCase {
 
     /**
-     * Test that the concurrent builder can build a plugin that is part of the 
reactor and then use it
-     * in a sibling module — without any pre-installed version in the local 
repository.
-     * <p>
-     * The concurrent builder schedules the plugin project to reach the {@code 
ready} phase before
-     * planning the consuming project, so {@code mvn package -b concurrent} 
works on a clean local repo.
+     * Test that a reactor plugin is automatically compiled and made available 
when the
+     * concurrent builder detects a cross-project plugin dependency, even when 
the user
+     * only requested a lifecycle phase before "compile" (here: "initialize").
      *
      * @throws Exception in case of failure
      */
     @Test
-    public void testitMNG1088() throws Exception {
+    void testitMNG1088() throws Exception {
         Path testDir = extractResources("mng-1088");
 
         Verifier verifier = newVerifier(testDir);
         verifier.setAutoclean(false);
         verifier.deleteDirectory("client/target");
         verifier.deleteArtifacts("org.apache.maven.its.mng1088");
-        verifier.addCliArguments("-DmavenVersion=" + 
verifier.getMavenVersion(), "-b", "concurrent", "package");
+        verifier.addCliArguments("-DmavenVersion=" + 
verifier.getMavenVersion(), "-b", "concurrent", "initialize");
         verifier.execute();
         verifier.verifyErrorFreeLog();
 
diff --git a/its/core-it-suite/src/test/resources/mng-1088/client/pom.xml 
b/its/core-it-suite/src/test/resources/mng-1088/client/pom.xml
index e287dc3c24..e2db889464 100644
--- a/its/core-it-suite/src/test/resources/mng-1088/client/pom.xml
+++ b/its/core-it-suite/src/test/resources/mng-1088/client/pom.xml
@@ -26,15 +26,13 @@ under the License.
   <packaging>jar</packaging>
 
   <name>Maven Integration Test :: MNG-1088 :: Plugin Client</name>
-  <description>
-    Uses the sibling plugin, which must be built by the concurrent builder
-    from source within this same reactor — no pre-installed version in the 
local repo.
-  </description>
+  <description>Test that the concurrent builder automatically builds a reactor 
plugin project up to READY
+    when another project uses that plugin, even if the requested phase is 
before "compile".</description>
 
   <build>
     <plugins>
       <plugin>
-        <!-- This is the plugin produced by the sibling reactor module -->
+        <!-- NOTE: That's exactly the same plugin as produced by the sibling 
project -->
         <groupId>org.apache.maven.its.mng1088</groupId>
         <artifactId>p</artifactId>
         <version>0.1-SNAPSHOT</version>
@@ -44,7 +42,7 @@ under the License.
             <goals>
               <goal>touch</goal>
             </goals>
-            <phase>package</phase>
+            <phase>initialize</phase>
             <configuration>
               <file>target/touch.txt</file>
             </configuration>
diff --git a/its/core-it-suite/src/test/resources/mng-1088/plugin/pom.xml 
b/its/core-it-suite/src/test/resources/mng-1088/plugin/pom.xml
index 6e250c9c76..bb3261c83e 100644
--- a/its/core-it-suite/src/test/resources/mng-1088/plugin/pom.xml
+++ b/its/core-it-suite/src/test/resources/mng-1088/plugin/pom.xml
@@ -26,27 +26,26 @@ under the License.
   <packaging>maven-plugin</packaging>
 
   <name>Maven Integration Test :: MNG-1088 :: Plugin</name>
-  <description>
-    A simple plugin built within the reactor, to be used by the sibling client 
module.
-    The concurrent builder must build this plugin first (up to the ready 
phase),
-    then allow the client to use it — without any pre-installed version.
-  </description>
+  <description>Test that the concurrent builder automatically builds a reactor 
plugin project up to READY
+    when another project uses that plugin, even if the requested phase is 
before "compile".</description>
 
   <properties>
     <maven.test.skip>true</maven.test.skip>
+    <mavenPluginPluginVersion>4.0.0-beta-3</mavenPluginPluginVersion>
   </properties>
 
   <dependencies>
+    <!-- Maven 4 API — available in the reactor-built plugin realm without 
extra JARs -->
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
+      <artifactId>maven-api-core</artifactId>
       <version>${mavenVersion}</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-      <version>3.15.2</version>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-api-di</artifactId>
+      <version>${mavenVersion}</version>
       <scope>provided</scope>
     </dependency>
   </dependencies>
@@ -56,8 +55,9 @@ under the License.
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-plugin-plugin</artifactId>
+        <version>${mavenPluginPluginVersion}</version>
         <configuration>
-          <goalPrefix>mng1088</goalPrefix>
+          <goalPrefix>coreit</goalPrefix>
         </configuration>
       </plugin>
     </plugins>
diff --git 
a/its/core-it-suite/src/test/resources/mng-1088/plugin/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
 
b/its/core-it-suite/src/test/resources/mng-1088/plugin/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
index 6d98110a69..57b887dc3a 100644
--- 
a/its/core-it-suite/src/test/resources/mng-1088/plugin/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
+++ 
b/its/core-it-suite/src/test/resources/mng-1088/plugin/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
@@ -18,62 +18,57 @@
  */
 package org.apache.maven.plugin.coreit;
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.api.Project;
+import org.apache.maven.api.di.Inject;
+import org.apache.maven.api.plugin.Log;
+import org.apache.maven.api.plugin.MojoException;
+import org.apache.maven.api.plugin.annotations.Mojo;
+import org.apache.maven.api.plugin.annotations.Parameter;
 
 /**
  * Creates a text file.
- *
+ * <p>
+ * This mojo uses the Maven 4 API so that it can be loaded from reactor-built
+ * classes (target/classes/) without requiring the Maven 3 compat jars.
  *
  * @author Benjamin Bentmann
  */
-@Mojo(name = "touch", defaultPhase = LifecyclePhase.VALIDATE)
-public class TouchMojo extends AbstractMojo {
+@Mojo(name = "touch", defaultPhase = "validate")
+public class TouchMojo implements org.apache.maven.api.plugin.Mojo {
+
+    @Inject
+    private Log log;
+
+    @Inject
+    private Project project;
 
     /**
      * The path to the output file, relative to the project base directory.
      */
     @Parameter(property = "touch.file", defaultValue = "target/touch.txt")
-    private File file;
+    private String file;
 
     /**
      * Runs this mojo.
      *
-     * @throws MojoExecutionException If the output file could not be created.
+     * @throws MojoException If the output file could not be created.
      */
-    public void execute() throws MojoExecutionException {
-        getLog().info("[MAVEN-CORE-IT-LOG] Creating output file: " + file);
+    @Override
+    public void execute() {
+        Path path = project.getBasedir().resolve(file);
+        log.info("[MAVEN-CORE-IT-LOG] Creating output file: " + 
path.toAbsolutePath());
 
         try {
-            file.getParentFile().mkdirs();
-            file.createNewFile();
+            Files.createDirectories(path.getParent());
+            if (!Files.exists(path)) {
+                Files.createFile(path);
+            }
         } catch (IOException e) {
-            throw new MojoExecutionException("Output file could not be 
created: " + file, e);
+            throw new MojoException("Output file could not be created: " + 
path, e);
         }
     }
 }
diff --git a/its/core-it-suite/src/test/resources/mng-1088/pom.xml 
b/its/core-it-suite/src/test/resources/mng-1088/pom.xml
index e816e1fb8c..880206582b 100644
--- a/its/core-it-suite/src/test/resources/mng-1088/pom.xml
+++ b/its/core-it-suite/src/test/resources/mng-1088/pom.xml
@@ -17,7 +17,7 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.1.0";>
+<project xmlns="http://maven.apache.org/POM/4.1.0"; root="true">
   <modelVersion>4.1.0</modelVersion>
 
   <groupId>org.apache.maven.its.mng1088</groupId>
@@ -26,13 +26,11 @@ under the License.
   <packaging>pom</packaging>
 
   <name>Maven Integration Test :: MNG-1088</name>
-  <description>
-    Test that the concurrent builder can build a plugin that is part of the 
reactor,
-    then use it in a sibling module — without any pre-installed version in the 
local repo.
-  </description>
+  <description>Test that the concurrent builder automatically builds a reactor 
plugin project up to READY
+    when another project uses that plugin, even if the requested phase is 
before "compile".</description>
 
-  <modules>
-    <module>plugin</module>
-    <module>client</module>
-  </modules>
+  <subprojects>
+    <subproject>plugin</subproject>
+    <subproject>client</subproject>
+  </subprojects>
 </project>

Reply via email to