gnodet commented on code in PR #12694:
URL: https://github.com/apache/maven/pull/12694#discussion_r4058009289
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:
##########
@@ -140,28 +125,12 @@ public void
injectTransformedArtifacts(RepositorySystemSession session, MavenPro
String newVersion;
if (version != null) {
HashSet<String> usedProperties = new HashSet<>();
- Map<String, String> pomProperties = pomProperties(session);
newVersion = interpolator.interpolate(version.trim(),
property -> {
- if
(session.getConfigProperties().containsKey(property)) {
- usedProperties.add(property);
- return (String)
session.getConfigProperties().get(property);
- }
- // CI-friendly version properties (revision, sha1,
changelist) may be
- // defined in the POM's <properties> section rather
than passed via -D.
- // In that case, fall back to the project's effective
properties so the
- // installed/deployed POM gets the literal version
inlined for consumers.
- String projectValue =
project.getProperties().getProperty(property);
- if (projectValue != null) {
- usedProperties.add(property);
- // Remember this value for replacePom(), which
does not have a project ref.
- // Key by groupId:artifactId:property to avoid
cross-project collision
- // in a reactor build where multiple modules may
define the same property.
- pomProperties.put(
- project.getGroupId() + ":" +
project.getArtifactId() + ":" + property,
- projectValue);
- return projectValue;
+ if
(!session.getConfigProperties().containsKey(property)) {
+ throw new IllegalArgumentException("Cannot inline
property " + property);
Review Comment:
Fixed in 628c65fa70: restored `pomProperties` fallback in
`PomInlinerTransformer` (matching master's GH-13192 fix), and also restored the
`MavenITgh13192PomInlinerCiFriendlyPropertyTest` IT test + resources that were
dropped in the squash-rebase.
##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java:
##########
@@ -836,11 +847,16 @@ private PluginAnalysisResults
analyzePluginsUsingEffectiveModels(
Path originalPomPath = entry.getKey();
try {
+ // Find the corresponding temp POM path
+ Path commonRoot = findCommonRoot(pomMap.keySet());
Review Comment:
Fixed in 628c65fa70: `findCommonRoot(pomMap.keySet())` is now hoisted out of
the loop with a comment explaining why.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]