[ 
https://issues.apache.org/jira/browse/MRELEASE-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17884089#comment-17884089
 ] 

ASF GitHub Bot commented on MRELEASE-1154:
------------------------------------------

gnodet commented on code in PR #230:
URL: https://github.com/apache/maven-release/pull/230#discussion_r1772487584


##########
maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java:
##########
@@ -517,128 +517,177 @@ private void rewriteArtifactVersions(
         if (elements == null) {
             return;
         }
-        String projectId = 
ArtifactUtils.versionlessKey(projectModel.getGroupId(), 
projectModel.getArtifactId());
         for (MavenCoordinate coordinate : elements) {
-            String rawVersion = coordinate.getVersion();
-            if (rawVersion == null) {
-                // managed dependency or unversioned plugin
-                continue;
-            }
+            rewriteArtifactVersion(coordinate, projectModel, properties, 
result, releaseDescriptor, simulate);
+        }
+    }
 
-            String rawGroupId = coordinate.getGroupId();
-            if (rawGroupId == null) {
-                if ("plugin".equals(coordinate.getName())) {
-                    rawGroupId = "org.apache.maven.plugins";
-                } else {
-                    // incomplete dependency
-                    continue;
-                }
-            }
-            String groupId = ReleaseUtil.interpolate(rawGroupId, projectModel);
+    private void rewriteArtifactVersion(
+            MavenCoordinate artifact,
+            Model projectModel,
+            Properties properties,
+            ReleaseResult result,
+            ReleaseDescriptor releaseDescriptor,
+            boolean simulate)
+            throws ReleaseExecutionException, ReleaseFailureException {
+        String projectId = 
ArtifactUtils.versionlessKey(projectModel.getGroupId(), 
projectModel.getArtifactId());
+        String rawVersion = artifact.getVersion();
+        if (rawVersion == null) {
+            // managed dependency or unversioned plugin
+            return;
+        }
 
-            String rawArtifactId = coordinate.getArtifactId();
-            if (rawArtifactId == null) {
-                // incomplete element
-                continue;
-            }
-            String artifactId = ReleaseUtil.interpolate(rawArtifactId, 
projectModel);
-
-            String key = ArtifactUtils.versionlessKey(groupId, artifactId);
-            String resolvedSnapshotVersion = getResolvedSnapshotVersion(key, 
releaseDescriptor);
-            String mappedVersion = getNextVersion(releaseDescriptor, key);
-            String originalVersion = getOriginalVersion(releaseDescriptor, 
key, simulate);
-            if (originalVersion == null) {
-                originalVersion = getOriginalResolvedSnapshotVersion(key, 
releaseDescriptor);
+        String rawGroupId = artifact.getGroupId();
+        if (rawGroupId == null) {
+            if ("plugin".equals(artifact.getName())) {
+                rawGroupId = "org.apache.maven.plugins";
+            } else {
+                // incomplete dependency
+                return;
             }
+        }
+        String groupId = ReleaseUtil.interpolate(rawGroupId, projectModel);
 
-            // MRELEASE-220
-            if (mappedVersion != null
-                    && mappedVersion.endsWith(Artifact.SNAPSHOT_VERSION)
-                    && !rawVersion.endsWith(Artifact.SNAPSHOT_VERSION)
-                    && !releaseDescriptor.isUpdateDependencies()) {
-                continue;
-            }
+        String rawArtifactId = artifact.getArtifactId();
+        if (rawArtifactId == null) {
+            // incomplete element
+            return;
+        }
+        String artifactId = ReleaseUtil.interpolate(rawArtifactId, 
projectModel);
+
+        String key = ArtifactUtils.versionlessKey(groupId, artifactId);
+        String resolvedSnapshotVersion = getResolvedSnapshotVersion(key, 
releaseDescriptor);
+        String mappedVersion = getNextVersion(releaseDescriptor, key);
+        String originalVersion = getOriginalVersion(releaseDescriptor, key, 
simulate);
+        if (originalVersion == null) {
+            originalVersion = getOriginalResolvedSnapshotVersion(key, 
releaseDescriptor);
+        }
 
-            if (mappedVersion != null) {
-                if (rawVersion.equals(originalVersion)) {
-                    logInfo(result, "  Updating " + artifactId + " to " + 
mappedVersion);
-                    coordinate.setVersion(mappedVersion);
-                } else {
-                    String property = 
extractPropertyFromExpression(rawVersion);
-                    if (property != null) {
-                        if (property.startsWith("project.")
-                                || property.startsWith("pom.")
-                                || "version".equals(property)) {
-                            if 
(!mappedVersion.equals(getNextVersion(releaseDescriptor, projectId))) {
-                                logInfo(result, "  Updating " + artifactId + " 
to " + mappedVersion);
-                                coordinate.setVersion(mappedVersion);
-                            } else {
-                                logInfo(result, "  Ignoring artifact version 
update for expression " + rawVersion);
-                            }
-                        } else if (properties != null) {
-                            // version is an expression, check for properties 
to update instead
-                            String propertyValue = 
properties.getProperty(property);
-                            if (propertyValue != null) {
-                                if (propertyValue.equals(originalVersion)) {
-                                    logInfo(result, "  Updating " + rawVersion 
+ " to " + mappedVersion);
-                                    // change the property only if the 
property is the same as what's in the reactor
-                                    properties.setProperty(property, 
mappedVersion);
-                                } else if 
(mappedVersion.equals(propertyValue)) {
-                                    // this property may have been updated 
during processing a sibling.
-                                    logInfo(
-                                            result,
-                                            "  Ignoring artifact version 
update for expression " + rawVersion
-                                                    + " because it is already 
updated");
-                                } else if (!mappedVersion.equals(rawVersion)) {
-                                    // WARNING: ${pom.*} prefix support and 
${version} is about to be dropped in mvn4!
-                                    // 
https://issues.apache.org/jira/browse/MNG-7404
-                                    // 
https://issues.apache.org/jira/browse/MNG-7244
-                                    if 
(mappedVersion.matches("\\$\\{project.+\\}")
-                                            || 
mappedVersion.matches("\\$\\{pom.+\\}")
-                                            || 
"${version}".equals(mappedVersion)) {
-                                        logInfo(
-                                                result,
-                                                "  Ignoring artifact version 
update for expression " + mappedVersion);
-                                        // ignore... we cannot update this 
expression
-                                    } else {
-                                        // the value of the expression 
conflicts with what the user wanted to release
-                                        throw new ReleaseFailureException("The 
artifact (" + key + ") requires a "
-                                                + "different version (" + 
mappedVersion + ") than what is found ("
-                                                + propertyValue + ") for the 
expression (" + rawVersion + ") in the "
-                                                + "project (" + projectId + 
").");
-                                    }
-                                }
-                            } else {
-                                if (CI_FRIENDLY_PROPERTIES.contains(property)) 
{
-                                    logInfo(
-                                            result,
-                                            "  Ignoring artifact version 
update for CI friendly expression "
-                                                    + rawVersion);
-                                } else {
-                                    // the expression used to define the 
version of this artifact may be inherited
-                                    // TODO needs a better error message, what 
pom? what dependency?
-                                    throw new ReleaseFailureException(
-                                            "Could not find property resolving 
version expression: " + rawVersion);
-                                }
-                            }
+        // MRELEASE-220
+        if (mappedVersion != null
+                && mappedVersion.endsWith(Artifact.SNAPSHOT_VERSION)
+                && !rawVersion.endsWith(Artifact.SNAPSHOT_VERSION)
+                && !releaseDescriptor.isUpdateDependencies()) {
+            return;
+        }
+
+        if (mappedVersion != null) {
+            if (rawVersion.equals(originalVersion)) {
+                logInfo(result, "  Updating " + key + " to " + mappedVersion);
+                artifact.setVersion(mappedVersion);
+            } else {
+                String property = extractPropertyFromExpression(rawVersion);
+                if (property != null) {
+                    if (property.startsWith("project.") || 
property.startsWith("pom.") || "version".equals(property)) {
+                        // those properties are read-only, replace with 
literal version in case it is supposed to be
+                        // different from the project's version
+                        if 
(!mappedVersion.equals(getNextVersion(releaseDescriptor, projectId))) {
+                            logInfo(result, "  Updating " + key + " to " + 
mappedVersion);
+                            artifact.setVersion(mappedVersion);
                         } else {
-                            // the expression used to define the version of 
this artifact may be inherited
-                            // TODO needs a better error message, what pom? 
what dependency?
-                            throw new ReleaseFailureException(
-                                    "Could not find properties resolving 
version expression : " + rawVersion);
+                            logInfo(result, "  Ignoring artifact version 
update for expression " + rawVersion);
                         }
                     } else {
-                        // different/previous version not related to current 
release
+                        rewritePropertyUsedInVersionExpression(
+                                projectId,
+                                key,
+                                rawVersion,
+                                mappedVersion,
+                                originalVersion,
+                                property,
+                                properties,
+                                result,
+                                releaseDescriptor);
                     }
                 }
-            } else if (resolvedSnapshotVersion != null) {
-                logInfo(result, "  Updating " + artifactId + " to " + 
resolvedSnapshotVersion);
+            }
+        } else if (resolvedSnapshotVersion != null) {
+            logInfo(result, "  Updating " + key + " to " + 
resolvedSnapshotVersion);
 
-                coordinate.setVersion(resolvedSnapshotVersion);
+            artifact.setVersion(resolvedSnapshotVersion);
+        } else {
+            // artifact not related to current release
+        }
+    }
+
+    /**
+     * This is a best-effort implementation for adjusting property values used 
in versions to be adjusted.
+     * It only ever rewrites properties in the non-effective local POM.
+     * If the property used in the version expression cannot be rewritten this 
is just logged for informational purposes.
+     *
+     * @param projectKey the key of the project where to rewrite
+     * @param artifactKey the key of the artifact whose version is changed
+     * @param rawVersion the non interpolated version of the artifact
+     * @param mappedVersion the new version of the artifact
+     * @param originalVersion the original version (prior modification) of the 
artifact in the reactor
+     * @param property the property referenced in the version expression
+     * @param properties the local properties of the project (may be {@code 
null})
+     * @param result
+     * @param releaseDescriptor
+     * @return {@code true} if the property was rewritten, otherwise {@code 
false}
+     */
+    boolean rewritePropertyUsedInVersionExpression(
+            String projectKey,
+            String artifactKey,
+            String rawVersion,
+            String mappedVersion,
+            String originalVersion,
+            String property,
+            Properties properties,
+            ReleaseResult result,
+            ReleaseDescriptor releaseDescriptor)
+            throws ReleaseFailureException {
+        if (properties == null) {
+            logInfo(
+                    result,
+                    "  Ignoring artifact version update for " + artifactKey + 
" as expression " + rawVersion
+                            + " cannot be locally resolved");
+            return false;
+        }
+        // check for value of property
+        boolean isUpdated = false;
+        String propertyValue = properties.getProperty(property);
+        if (propertyValue != null) {
+            if (propertyValue.equals(originalVersion)) {
+                logInfo(result, "  Updating " + rawVersion + " to " + 
mappedVersion);
+                // change the property only if the property is the same as 
what's in the reactor
+                properties.setProperty(property, mappedVersion);
+                isUpdated = true;
+            } else if (mappedVersion.equals(propertyValue)) {
+                // this property may have been updated during processing a 
sibling.
+                logInfo(
+                        result,
+                        "  Ignoring artifact version update for expression " + 
rawVersion
+                                + " because it is already updated");
+            } else if (!mappedVersion.equals(rawVersion)) {
+                // WARNING: ${pom.*} prefix support and ${version} is about to 
be dropped in mvn4!
+                // https://issues.apache.org/jira/browse/MNG-7404
+                // https://issues.apache.org/jira/browse/MNG-7244
+                if (mappedVersion.matches("\\$\\{project.+\\}")
+                        || mappedVersion.matches("\\$\\{pom.+\\}")
+                        || "${version}".equals(mappedVersion)) {
+                    logInfo(result, "  Ignoring artifact version update for 
expression " + mappedVersion);
+                    // ignore... we cannot update this expression
+                } else {
+                    // the value of the expression conflicts with what the 
user wanted to release
+                    throw new ReleaseFailureException("The artifact (" + 
artifactKey + ") requires a "
+                            + "different version (" + mappedVersion + ") than 
what is found ("
+                            + propertyValue + ") for the expression (" + 
rawVersion + ") in the "
+                            + "project (" + projectKey + ").");
+                }
+            }
+        } else {
+            if (CI_FRIENDLY_PROPERTIES.contains(property)) {
+                logInfo(result, "  Ignoring artifact version update for CI 
friendly expression " + rawVersion);
             } else {
-                // artifact not related to current release
+                // the expression used to define the version of this artifact 
may be inherited
+                logInfo(

Review Comment:
   We need to take into account the fact that modelVersion 4.1.0 will allow 
users to only define the version in the root parent, all other versions will be 
inferred.  I would not want tons of warnings when using such setup.
   If this is a supported use case, I don't see why a warning would be legit.





> [REGRESSION] MRELEASE-1109 breaks release of Maven Surefire
> -----------------------------------------------------------
>
>                 Key: MRELEASE-1154
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-1154
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 3.1.0, 3.1.1
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: next-release
>
>
> Upgraded Maven Surefire to Parent 43 and failed to prepare release with {{mvn 
> release:prepare -e}}:
> {noformat}
> [INFO]   Ignoring artifact version update for expression ${project.version}
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary for Apache Maven Surefire 3.5.1-SNAPSHOT:
> [INFO]
> [INFO] Apache Maven Surefire .............................. FAILURE [ 58.812 
> s]
> [INFO] Surefire Shared Utils .............................. SKIPPED
> [INFO] Surefire Logger API ................................ SKIPPED
> [INFO] Surefire API ....................................... SKIPPED
> [INFO] Surefire Extensions API ............................ SKIPPED
> [INFO] Surefire Extensions SPI ............................ SKIPPED
> [INFO] Surefire Booter .................................... SKIPPED
> [INFO] Maven Surefire Test-Grouping Support ............... SKIPPED
> [INFO] Surefire Providers ................................. SKIPPED
> [INFO] Shared JUnit3 Provider Code ........................ SKIPPED
> [INFO] Shared Java 5 Provider Base ........................ SKIPPED
> [INFO] Shared JUnit4 Provider Code ........................ SKIPPED
> [INFO] Shared JUnit48 Provider Code ....................... SKIPPED
> [INFO] Surefire JUnit Runner .............................. SKIPPED
> [INFO] Surefire JUnit4 Runner ............................. SKIPPED
> [INFO] Maven Surefire Common .............................. SKIPPED
> [INFO] Surefire JUnitCore Runner .......................... SKIPPED
> [INFO] Surefire JUnit Platform Runner ..................... SKIPPED
> [INFO] Surefire TestNG Utils .............................. SKIPPED
> [INFO] Surefire TestNG Runner ............................. SKIPPED
> [INFO] ShadeFire JUnit3 Provider .......................... SKIPPED
> [INFO] Surefire Report Parser ............................. SKIPPED
> [INFO] Maven Surefire Plugin .............................. SKIPPED
> [INFO] Maven Failsafe Plugin .............................. SKIPPED
> [INFO] Maven Surefire Report Plugin ....................... SKIPPED
> [INFO] Maven Surefire Integration Tests ................... SKIPPED
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  01:02 min
> [INFO] Finished at: 2024-08-23T11:32:04+02:00
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-release-plugin:3.1.0:prepare (default-cli) on 
> project surefire: Could not find properties resolving version expression : 
> ${surefire-shared-utils.version} -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.maven.plugins:maven-release-plugin:3.1.0:prepare 
> (default-cli) on project surefire: Could not find properties resolving 
> version expression : ${surefire-shared-utils.version}
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 
> (MojoExecutor.java:333)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute 
> (MojoExecutor.java:316)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:212)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:174)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 
> (MojoExecutor.java:75)
>     at org.apache.maven.lifecycle.internal.MojoExecutor$1.run 
> (MojoExecutor.java:162)
>     at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute 
> (DefaultMojosExecutionStrategy.java:39)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:159)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:105)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:73)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:53)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:118)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:566)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:255)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:201)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:361)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:314)
> Caused by: org.apache.maven.plugin.MojoFailureException: Could not find 
> properties resolving version expression : ${surefire-shared-utils.version}
>     at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease 
> (PrepareReleaseMojo.java:434)
>     at org.apache.maven.plugins.release.PrepareReleaseMojo.execute 
> (PrepareReleaseMojo.java:367)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:126)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 
> (MojoExecutor.java:328)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute 
> (MojoExecutor.java:316)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:212)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:174)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 
> (MojoExecutor.java:75)
>     at org.apache.maven.lifecycle.internal.MojoExecutor$1.run 
> (MojoExecutor.java:162)
>     at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute 
> (DefaultMojosExecutionStrategy.java:39)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:159)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:105)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:73)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:53)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:118)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:566)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:255)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:201)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:361)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:314)
> Caused by: org.apache.maven.shared.release.ReleaseFailureException: Could not 
> find properties resolving version expression : 
> ${surefire-shared-utils.version}
>     at 
> org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.rewriteArtifactVersions
>  (AbstractRewritePomsPhase.java:627)
>     at 
> org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transformDocument
>  (AbstractRewritePomsPhase.java:389)
>     at 
> org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transformProject
>  (AbstractRewritePomsPhase.java:260)
>     at 
> org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transform 
> (AbstractRewritePomsPhase.java:223)
>     at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.execute 
> (AbstractRewritePomsPhase.java:160)
>     at org.apache.maven.shared.release.DefaultReleaseManager.prepare 
> (DefaultReleaseManager.java:193)
>     at org.apache.maven.shared.release.DefaultReleaseManager.prepare 
> (DefaultReleaseManager.java:110)
>     at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease 
> (PrepareReleaseMojo.java:430)
>     at org.apache.maven.plugins.release.PrepareReleaseMojo.execute 
> (PrepareReleaseMojo.java:367)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:126)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 
> (MojoExecutor.java:328)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute 
> (MojoExecutor.java:316)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:212)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:174)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 
> (MojoExecutor.java:75)
>     at org.apache.maven.lifecycle.internal.MojoExecutor$1.run 
> (MojoExecutor.java:162)
>     at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute 
> (DefaultMojosExecutionStrategy.java:39)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:159)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:105)
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:73)
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:53)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:118)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:566)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:255)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:201)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:361)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:314)
> [ERROR] 
> [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/MojoFailureException
> {noformat}
> bisected down to:
> {noformat}
> osipovmi@deblndw011x:~/var/Projekte/maven-release ((9e0713b8...)|BISECTING)
> $ git bisect bad
> 9e0713b83d99723ebeb3e8347f3f69c69c585ed0 is the first bad commit
> commit 9e0713b83d99723ebeb3e8347f3f69c69c585ed0 (HEAD)
> Author: Konrad Windszus <k...@apache.org>
> Date:   2023-08-20T16:28:20+02:00
>     [MRELEASE-1109] Support CI friendly versions (#198)
>  .../maven/shared/release/phase/AbstractRewritePomsPhase.java      | 150 
> ++++++++++++++++++++----------
>  .../apache/maven/shared/release/transform/jdom2/JDomModel.java    |  17 +++-
>  .../apache/maven/shared/release/transform/jdom2/JDomParent.java   |   2 +-
>  .../shared/release/phase/RewritePomsForReleasePhaseTest.java      |  14 +++
>  .../maven/shared/release/transform/jdom2/JDomModelTest.java       |   9 +-
>  .../maven/shared/release/transform/jdom2/JDomParentTest.java      |  11 ++-
>  .../pom-with-parent-and-cifriendly-expressions/expected-pom.xml   |  39 
> ++++++++
>  .../pom-with-parent-and-cifriendly-expressions/pom.xml            |  39 
> ++++++++
>  .../subproject1/expected-pom.xml                                  |  28 
> ++++++
>  .../subproject1/pom.xml                                           |  28 
> ++++++
>  10 files changed, 282 insertions(+), 55 deletions(-)
>  create mode 100644 
> maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-cifriendly-expressions/expected-pom.xml
>  create mode 100644 
> maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-cifriendly-expressions/pom.xml
>  create mode 100644 
> maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-cifriendly-expressions/subproject1/expected-pom.xml
>  create mode 100644 
> maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-cifriendly-expressions/subproject1/pom.xml
> {noformat}
> Reverted the release locally on master and tried a snapshot. It does perform 
> the dry run as expected. We either need to fix or revert the commit.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to