maven icon indicating copy to clipboard operation
maven copied to clipboard

variables used for distributionManagement from settings.xml no longer work in 4.0.0-rc-5

Open sellersj opened this issue 2 months ago • 2 comments

Affected version

4.0.0-rc-5

Bug description

For years we've had variables for where artifacts should deploy contained in the settings.xml file. Has worked until rc-5. It worked in rc-4.

Sample command that shows the issue is just the help:effective-pom ~/Downloads/apache-maven-4.0.0-rc-5/bin/mvn -V -s settings.xml help:effective-pom

Attached are an example pom and settings that shows it. TOOLS_HOST is an env variable that's properly set. For the test you can set it to something like "example.com"

[ERROR] Some problems were encountered while processing the POMs
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.example:Zminimal:0.0.1-SNAPSHOT (/mnt/c/users/sellersj/git/zminimal/pom.xml) has 4 errors
[ERROR]     'distributionManagement.repository.[${distributionManagement-internal-released-id}].id' contains an uninterpolated expression. @ line 22, column 7
[ERROR]     'distributionManagement.snapshotRepository.[${distributionManagement-internal-snapshots-id}].id' contains an uninterpolated expression. @ line 26, column 7
[ERROR]     'distributionManagement.repository.[${distributionManagement-internal-released-id}].id' contains an uninterpolated expression. @ line 22, column 7
[ERROR]     'distributionManagement.snapshotRepository.[${distributionManagement-internal-snapshots-id}].id' contains an uninterpolated expression. @ line 26, column 7
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[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/ProjectBuildingException

pom.xml settings.xml

sellersj avatar Nov 28 '25 21:11 sellersj

Isn't that related to https://github.com/apache/maven/issues/11076?

sudo-mkdir avatar Dec 08 '25 10:12 sudo-mkdir

Looks like it would be related. Thanks for pointing that out.

I think that we have a similar use case. In ours, I have a mirror of our build infra and test the build pipeline before upgrades and I don't want artifacts from this dev / staging env messing up the "prod" systems.

sellersj avatar Dec 09 '25 13:12 sellersj

Since I want the deployment target specified in the settings.xml, I can set properties there for altReleaseDeploymentRepository and altSnapshotDeploymentRepository. https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html

Then I would have to make sure that the projects are using at least 2.8 version of that plugin and I can delete the distributionManagement sections or just make sure that the id tag is not a variable.

Those are work arounds, but I can move my org to that setup I think.

Going to close this ticket as not planned.

sellersj avatar Dec 18 '25 18:12 sellersj