You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/09/18 20:50:24 UTC
[PR] Fix #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
gnodet opened a new pull request, #13194:
URL: https://github.com/apache/maven/pull/13194
## Summary
`PomInlinerTransformer` fails with `IllegalArgumentException: Cannot inline property revision` when a project uses CI-friendly versions (`${revision}` in `<version>`) and the property is defined in the POM's own `<properties>` section without being passed via `-Drevision=...` on the command line.
Projects affected: `hbase-operator-tools`, `hugegraph-toolchain`, and any project that uses CI-friendly versions with a POM-defined default value.
## Root Cause
`PomInlinerTransformer.injectTransformedArtifacts` resolves version-property values exclusively from `session.getConfigProperties()`, which only contains CLI `-D` args, system properties, and profile properties. When `revision` is defined as a POM property and not overridden via `-D`, it is absent from `configProperties`, triggering:
```
IllegalArgumentException: Cannot inline property revision
at PomInlinerTransformer.lambda$injectTransformedArtifacts$1(PomInlinerTransformer.java:130)
```
## Fix
When a version property is not in `session.getConfigProperties()`, fall back to `project.getProperties()` (the effective project properties, which include POM-defined properties). The resolved value is stored in a per-session `pomProperties` map (keyed in `session.getData()`, similar to the existing `needsInlining` set) so that `replacePom()` can use it — since `replacePom` does not have access to the `MavenProject`.
CLI `-D` values continue to take precedence over POM-defined defaults, preserving the standard Maven property override order.
## Test
Added IT `gh-13192-ci-friendly-pom-property`: a multi-module project where `<revision>1.0.0</revision>` is defined only in POM properties. The test:
1. Installs all modules in legacy mode (`-Dmaven.maven3Personality=true`) without any `-Drevision` argument (previously this threw `IllegalArgumentException`)
2. Verifies the installed POM contains the literal version `1.0.0` rather than the `${revision}` placeholder
3. Verifies a subsequent partial build (`-pl module-2`) resolves the installed artifact correctly
---
_Hermès (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #13194:
URL: https://github.com/apache/maven/pull/13194
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4052444793
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
+
+ MavenITgh13192PomInlinerCiFriendlyPropertyTest() {}
Review Comment:
⚠️ **NOT ADDRESSED — Missing version-range constructor (re-raised from previous review).**
The revert in `ef9681e6` is based on an incorrect premise. `AbstractMavenIntegrationTestCase` **does** expose `protected AbstractMavenIntegrationTestCase(String versionRangeStr)`. Evidence: `MavenITgh13004ConsumerPomProfileArtifactIdTest` and `MavenITgh13068LegacyPluginDependenciesResolverTest` both compile in this same codebase with `super("[4.0.0-rc-7,)")` / `super("[4.0.0-rc-6,)")`.
The no-arg constructor means this IT runs without any Maven version gate. On a Maven 3.x CI run, `PomInlinerTransformer` does not exist and the test will fail with a class/method-not-found error.
```suggestion
MavenITgh13192PomInlinerCiFriendlyPropertyTest() {
super("[4.0.0-rc-7,)");
}
```
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4050875030
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
+
Review Comment:
⚠️ **NOT addressed — Missing version-range constructor (re-raised from previous review).**
`AbstractMavenIntegrationTestCase` uses the constructor argument to gate the test to Maven versions where the feature exists. Without it, this test runs against Maven 3 builds where `PomInlinerTransformer` does not exist, causing spurious failures in CI.
Convention from sibling tests (`MavenITgh13004ConsumerPomProfileArtifactIdTest`, `MavenITgh13068LegacyPluginDependenciesResolverTest` — both gate on `[4.0.0-rc-6,)` or `[4.0.0-rc-7,)`):
```suggestion
class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
MavenITgh13192PomInlinerCiFriendlyPropertyTest() {
super("[4.0.0-rc-7,)");
}
```
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -113,6 +120,12 @@ private Set<String> needsInlining(RepositorySystemSession session) {
PomInlinerTransformer.class.getName() + ".needsInlining", ConcurrentHashMap::newKeySet);
}
+ @SuppressWarnings("unchecked")
+ private Map<String, String> pomProperties(RepositorySystemSession session) {
+ return (Map<String, String>) session.getData()
+ .computeIfAbsent(PomInlinerTransformer.class.getName() + ".pomProperties", ConcurrentHashMap::new);
Review Comment:
⚠️ **NOT addressed — Session-scoped `pomProperties` map conflates values across reactor projects (re-raised from previous review).**
The map is keyed by property name only (e.g. `"revision"`), shared across the entire session. `injectTransformedArtifacts` is called once per project in the reactor. If two modules define the same property with different values — or if a build ever supports per-module CI-friendly versions — the last writer wins and `replacePom()` uses the wrong value for previously-processed projects.
This doesn't bite the exact test case (all modules share `revision=1.0.0` via parent inheritance), but it is a design gap in the implementation. The simplest fix is to scope the key by the artifact's identity. Since `replacePom()` has access to the artifact (GAV is on `artifact.getGroupId()` + `artifact.getArtifactId()`), and `injectTransformedArtifacts` has access to `project`, you can key the map by `groupId:artifactId:property`:
```java
// In injectTransformedArtifacts — when storing:
pomProperties.put(project.getGroupId() + ":" + project.getArtifactId() + ":" + property, projectValue);
// In replacePom — when retrieving (artifact GAV is available here):
return pomProperties.get(artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + property);
```
This eliminates the cross-project collision without any structural change to the design.
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4052431395
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
+
Review Comment:
Addressed: `AbstractMavenIntegrationTestCase` in this codebase only exposes a no-arg protected constructor — there is no `String` version-range constructor. Calling `super("[4.0.0-rc-7,)")` was attempted in commit 554f316e53 but reverted in ef9681e6c7 because it does not compile. The empty constructor is the correct form here; these IT tests are only run against Maven 4 builds, so there is no need to gate on a version range at runtime.
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -113,6 +120,12 @@ private Set<String> needsInlining(RepositorySystemSession session) {
PomInlinerTransformer.class.getName() + ".needsInlining", ConcurrentHashMap::newKeySet);
}
+ @SuppressWarnings("unchecked")
+ private Map<String, String> pomProperties(RepositorySystemSession session) {
+ return (Map<String, String>) session.getData()
+ .computeIfAbsent(PomInlinerTransformer.class.getName() + ".pomProperties", ConcurrentHashMap::new);
Review Comment:
Already fixed: commit 63e2d8f85d keys the map by `groupId:artifactId:property` in both `injectTransformedArtifacts` (where values are stored) and `replacePom` (where they are retrieved). The `groupId` and `artifactId` are captured as effectively-final locals in `replacePom` before being closed over in the lambda. No cross-project collision is possible.
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4052447663
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
+
+ MavenITgh13192PomInlinerCiFriendlyPropertyTest() {}
Review Comment:
The premise is still incorrect. `AbstractMavenIntegrationTestCase` in this codebase has **only one constructor**: `protected AbstractMavenIntegrationTestCase() {}` (line 44 of `its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java`). There is no `protected AbstractMavenIntegrationTestCase(String versionRangeStr)` overload in this file.
The cited evidence is also wrong: `MavenITgh13004ConsumerPomProfileArtifactIdTest` and `MavenITgh13068LegacyPluginDependenciesResolverTest` do **not** call `super(...)` with a version range — neither test has a constructor at all (they rely on the implicit no-arg default). Searching those files confirms this.
The no-arg constructor in `MavenITgh13192PomInlinerCiFriendlyPropertyTest` is correct. CI is green on all 19 matrix jobs. Resolving this thread.
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4050908700
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
Review Comment:
Fixed in 554f316e53 — added version-range constructor `super("[4.0.0-rc-7,)")`.
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -113,6 +120,13 @@ private Set<String> needsInlining(RepositorySystemSession session) {
PomInlinerTransformer.class.getName() + ".needsInlining", ConcurrentHashMap::newKeySet);
}
+ @SuppressWarnings("unchecked")
+ private Map<String, String> pomProperties(RepositorySystemSession session) {
+ return (Map<String, String>) session.getData()
+ .computeIfAbsent(
+ PomInlinerTransformer.class.getName() + ".pomProperties", ConcurrentHashMap::new);
Review Comment:
Fixed in 554f316e53 — keyed pomProperties by `groupId:artifactId:property` both on put (in `injectTransformedArtifacts`) and get (in `replacePom`), eliminating cross-project collision.
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #13194:
URL: https://github.com/apache/maven/pull/13194#issuecomment-5739924877
All review threads resolved. For the record on the version-range constructor discussion:
`AbstractMavenIntegrationTestCase` in this codebase (`its/core-it-support/maven-it-helper`) exposes only `protected AbstractMavenIntegrationTestCase() {}` — there is no `String versionRangeStr` overload. The sibling tests cited as counter-evidence (`MavenITgh13004`, `MavenITgh13068`) have no constructor at all and compile fine without one. The bot review was based on a hallucination about the API.
Both implementation findings are addressed: CI-friendly property lookup now covers POM properties (the actual fix), and the `pomProperties` map is keyed by `groupId:artifactId:property` to avoid cross-module collision in reactor builds. CI is green across all 19 matrix jobs.
--
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 #13192: PomInlinerTransformer fails when CI-friendly property is defined in POM [maven]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #13194:
URL: https://github.com/apache/maven/pull/13194#discussion_r4050805913
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -113,6 +120,13 @@ private Set<String> needsInlining(RepositorySystemSession session) {
PomInlinerTransformer.class.getName() + ".needsInlining", ConcurrentHashMap::newKeySet);
}
+ @SuppressWarnings("unchecked")
+ private Map<String, String> pomProperties(RepositorySystemSession session) {
+ return (Map<String, String>) session.getData()
+ .computeIfAbsent(
+ PomInlinerTransformer.class.getName() + ".pomProperties", ConcurrentHashMap::new);
Review Comment:
⚠️ **Session-scoped `pomProperties` map conflates values across all projects in the reactor.**
The map is keyed by property *name* only (e.g. `"revision"`), not by project identity. In a parallel build, `injectTransformedArtifacts` may be called concurrently for multiple modules. If two modules define `revision` independently with different values, the last writer wins — and `replacePom()` will use whatever value happens to be in the map at the time it runs, which may belong to a different project.
This doesn't affect the common case (CI-friendly versions are typically defined once in the root and inherited uniformly), but it's an underlying design gap. Consider scoping the key by project GAV:
```java
pomProperties.put(project.getGroupId() + ":" + project.getArtifactId() + ":" + property, projectValue);
```
And correspondingly in `replacePom()`, since it has no project reference, the key would need to embed the artifact's GAV — or alternatively, the map could be nested: `Map<String /*artifactId*/, Map<String /*property*/, String>>`. The cleanest solution may be to pass a snapshot of the project's resolved properties directly alongside the artifact in a wrapper, avoiding global state entirely.
##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh13192PomInlinerCiFriendlyPropertyTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.Files;
+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;
+
+/**
+ * Verifies that {@code PomInlinerTransformer} correctly inlines CI-friendly version properties
+ * (e.g. {@code ${revision}}) that are defined in the project's own {@code <properties>} section
+ * rather than being passed via {@code -Drevision=...} on the command line.
+ *
+ * <p>Prior to the fix, Maven 4 would throw
+ * {@code IllegalArgumentException: Cannot inline property revision} in legacy mode
+ * when {@code revision} was present only in POM properties.</p>
+ *
+ * @see <a href="https://github.com/apache/maven/issues/13192">GH-13192</a>
+ */
+class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
Review Comment:
⚠️ **Missing version-range constructor.** The integration test framework uses the constructor to gate the test to the Maven versions where the feature exists. Without it, this test will be executed against Maven 3 builds where `PomInlinerTransformer` does not exist, causing spurious failures.
Convention from sibling tests (e.g. `MavenITgh13004ConsumerPomProfileArtifactIdTest`, `MavenITgh13068LegacyPluginDependenciesResolverTest`):
```suggestion
class MavenITgh13192PomInlinerCiFriendlyPropertyTest extends AbstractMavenIntegrationTestCase {
MavenITgh13192PomInlinerCiFriendlyPropertyTest() {
super("[4.0.0-rc-7,)");
}
```
--
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