[
https://issues.apache.org/jira/browse/MRELEASE-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725360#comment-17725360
]
ASF GitHub Bot commented on MRELEASE-1123:
------------------------------------------
slawekjaranowski commented on code in PR #186:
URL: https://github.com/apache/maven-release/pull/186#discussion_r1202099240
##########
maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java:
##########
@@ -543,9 +543,10 @@ private List<Plugin>
createReleasePlugins(ReleaseDescriptor releaseDescriptor, M
}
releasePlugin.setExecutions(plugin.getExecutions());
releasePlugin.setDependencies(plugin.getDependencies());
- releasePlugin.setGoals(plugin.getGoals());
releasePlugin.setInherited(plugin.getInherited());
- releasePlugin.setConfiguration(plugin.getConfiguration());
+ if (plugin.getConfiguration() != null) {
+
releasePlugin.setConfiguration(plugin.getConfiguration());
Review Comment:
Maven 4 code in
`org.apache.maven.model.ConfigurationContainer#setConfiguration`
```
public void setConfiguration( Object configuration )
{
if ( ! Objects.equals( ( ( Xpp3Dom ) configuration ).getDom(),
getDelegate().getConfiguration() ) )
{
update( getDelegate().withConfiguration( ( ( Xpp3Dom )
configuration ).getDom() ) );
( ( Xpp3Dom ) configuration ).setChildrenTracking( this::replace
);
}
}
```
but `getConfiguration` can return `null`
```
public Object getConfiguration()
{
return getDelegate().getConfiguration() != null ? new Xpp3Dom(
getDelegate().getConfiguration(), this::replace ) : null;
}
```
in 3.x simply field is set
> Maven Release plugin doesn't work in maven 4
> --------------------------------------------
>
> Key: MRELEASE-1123
> URL: https://issues.apache.org/jira/browse/MRELEASE-1123
> Project: Maven Release Plugin
> Issue Type: Bug
> Components: prepare
> Affects Versions: 3.0.0
> Environment: Any
> Reporter: Lenny Primak
> Assignee: Guillaume Nodet
> Priority: Blocker
>
> {code:java}
> mvn -B -ntp -C release:prepare release:perform{code}
>
> {code:java}
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-release-plugin:3.0.0:prepare (default-cli) on
> project flowlogix: Unable to parse configuration of mojo
> org.apache.maven.plugins:maven-release-plugin:3.0.0:prepare for parameter
> projectVersionPolicyConfig: Cannot set 'projectVersionPolicyConfig' in class
> org.apache.maven.plugins.release.PrepareReleaseMojo: Can not set
> org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration field
> org.apache.maven.plugins.release.PrepareReleaseMojo.projectVersionPolicyConfig
> to org.apache.maven.internal.xml.XmlPlexusConfiguration -> [Help 1]{code}
> Maven 4.0.0-alpha-5 and release plugin 3.0.0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)