You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "sebtiem (via GitHub)" <gi...@apache.org> on 2026/10/16 09:16:30 UTC
[PR] fix #13521: restore phase config merging for null input [maven]
sebtiem opened a new pull request, #13561:
URL: https://github.com/apache/maven/pull/13561
Fixes #13521.
With Commit 2a9f39336cec1d8e52d30cc48503d51ed8672536 (DefaultLifecycleExecutionPlanCalculator, line 567 in the added lines), there was a null check introduced for the merge-mechanism that is null safe to use.
The Surefire-Plugin ITs Surefire570MultipleReportDirectoriesIT and Surefire260TestWithIdenticalNamesIT fail under Maven 4.0.0-RC7 due to this null-check.
Also as I could see, there is no test or IT in Maven Core that covers this case so far.
---
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
check one of the following:
- [X] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [X] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix #13521: restore phase config merging for null input [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #13561:
URL: https://github.com/apache/maven/pull/13561#issuecomment-6270212310
<!-- maven-backport-bot -->
**Backport PRs created:**
- ✅ `maven-4.0.x` → #13630
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix #13521: restore phase config merging for null input [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #13561:
URL: https://github.com/apache/maven/pull/13561
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix #13521: restore phase config merging for null input [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #13561:
URL: https://github.com/apache/maven/pull/13561#discussion_r4297747370
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITGh13521PhaseConfigurationTest.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.maven.it;
+
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class MavenITGh13521PhaseConfigurationTest extends AbstractMavenIntegrationTestCase {
+
+ @Test
+ void testPhaseConfigurationAppliedToUnconfiguredExecution() throws Exception {
+ Path testDir = extractResources("gh-13521-phase-configuration");
+
+ Verifier verifier = newVerifier(testDir);
+ verifier.setAutoclean(false);
+ verifier.deleteDirectory("target");
+ verifier.addCliArgument("org.apache.maven.its.plugins:maven-it-plugin-fork:fork-phase-config");
+ verifier.execute();
+ verifier.verifyErrorFreeLog();
+
+ verifier.verifyFilePresent("target/phase-config/touch.txt");
+ verifier.verifyFileNotPresent("target/touch.txt");
+ }
+
+}
Review Comment:
🔧 **Nit:** Missing newline at end of file. Most editors and Git hooks expect a trailing newline.
```suggestion
}
```
##########
its/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkPhaseConfigMojo.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.plugin.coreit;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Execute;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+@Mojo(name = "fork-phase-config")
+@Execute(phase = LifecyclePhase.GENERATE_RESOURCES, lifecycle = "phase-config")
+public class ForkPhaseConfigMojo extends AbstractMojo {
+
+ @Override
+ public void execute() {}
+}
Review Comment:
🔧 **Nit:** Missing newline at end of file.
```suggestion
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix #13521: restore phase config merging for null input [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #13561:
URL: https://github.com/apache/maven/pull/13561#issuecomment-6270184026
<!-- maven-backport-bot -->
**Conflicts — manual resolution needed:**
- ❌ `maven-4.0.x`: Cherry-pick conflict in:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix #13521: restore phase config merging for null input [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #13561:
URL: https://github.com/apache/maven/pull/13561#discussion_r4297789685
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITGh13521PhaseConfigurationTest.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.maven.it;
+
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class MavenITGh13521PhaseConfigurationTest extends AbstractMavenIntegrationTestCase {
Review Comment:
🔧 **Naming convention + missing Javadoc:**
1. IT classes for GitHub issues use lowercase `gh`, not `Gh`. Rename to `MavenITgh13521PhaseConfigurationTest`.
2. Class is missing the standard Javadoc comment with the issue link, e.g.:
```java
/**
* https://issues.apache.org/jira/browse/MNG-XXXX / https://github.com/apache/maven/issues/13521
*
* Tests that phase configuration is applied to forked executions with no prior configuration.
*/
```
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITGh13521PhaseConfigurationTest.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.maven.it;
+
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
Review Comment:
⚠️ **Unused imports:** `assertFalse` and `assertTrue` are never called — all assertions use `Verifier` methods. Remove both imports.
```suggestion
import java.nio.file.Path;
import org.junit.jupiter.api.Test;
```
##########
its/core-it-suite/src/test/resources/gh-13521-phase-configuration/pom.xml:
##########
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>gh-13521-phase-config</groupId>
+ <artifactId>base-project</artifactId>
Review Comment:
💬 **Misleading comment:** `<!-- CI-friendly version defined only in <properties>, NOT via -D on command line -->` describes CI-friendly version portability but this is just an IT test fixture — the comment adds unrelated noise. Remove it or replace with something neutral.
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITGh13521PhaseConfigurationTest.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.maven.it;
+
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
Review Comment:
🔧 **Duplicate import:** `assertFalse` is imported twice (lines 25 and 26 are identical). Remove one.
##########
its/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkPhaseConfigMojo.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.maven.plugin.coreit;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Execute;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
Review Comment:
⚠️ **Unused imports:** `File`, `MojoExecutionException`, and `Parameter` are imported but never used — `execute()` is empty and the class has no fields. Remove all three.
```suggestion
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org