Affected version
Apache Maven 3.9.12 (3.9.x)
Bug description
Maven/Nexus Variable Substitution Bug
Issue Summary
When deploying a Maven project (POM only packaging) to Nexus, the deployment fails if the pom.xml contains three or more ${} variable references (even in comments). If there are two or fewer, the deploy succeeds, but the variables are not resolved in the uploaded .pom file. This breaks standard Maven property usage and prevents correct artifact publishing.
Troubleshooting and Observations
- Tested with minimal and realistic POMs.
- Behavior:
- 3+
${}: Deploy fails, .pom is not uploaded.
- 2 or fewer
${}: Deploy succeeds, but variables remain unresolved in the uploaded .pom.
- Tested with both property variables and hardcoded values.
- Changing the Nexus layout policy to Permissive did not resolve the variable substitution issue.
Example POMs
Fails to Deploy (3 ${} references)
<project>
...
<!-- ${} -->
<!-- ${} -->
<!-- ${} -->
...
</project>
Deploys, but Variables Not Resolved (2 ${} references)
<project>
...
<!-- ${} -->
<!-- ${} -->
...
</project>
Realistic Example from pom-wip.xml
<properties>
<fmt-maven-plugin.version>2.13</fmt-maven-plugin.version>
<formatter-maven-plugin.version>2.27.0</formatter-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${fmt-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>${formatter-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
Nexus Audit Log Snippets
Failed Upload (with property variables)
{"timestamp":"2026-01-28 14:11:18,346+0000", ... "kind":"" ...}
... (no kind "pom" or packaging "pom" in logs)
Successful Upload (with hardcoded versions)
{"timestamp":"2026-01-28 14:52:03,493+0000", ... "kind":"pom" ...}
{"timestamp":"2026-01-28 14:52:03,552+0000", ... "kind":"ARTIFACT" ...}
... (packaging "pom" and kind "pom" present in logs)
Impact
- Standard Maven property usage is broken.
- Variable substitution does not work as expected.
- Artifacts may not be published or may be published with unresolved variables.
Steps to Reproduce
- Create a minimal POM with 3+
${} references (even in comments).
- Run
mvn deploy to Nexus.
- Observe that the
.pom file is not uploaded.
- Reduce to 2 or fewer
${} and deploy again; upload succeeds but variables are not resolved.
Environment
- Maven 3.9.x
- Nexus Repository Manager 3.x
Request
- Please investigate and advise on a fix or workaround.
- Is this a known issue? Are there patches or configuration changes that can resolve it?
Affected version
Apache Maven 3.9.12 (3.9.x)
Bug description
Maven/Nexus Variable Substitution Bug
Issue Summary
When deploying a Maven project (POM only packaging) to Nexus, the deployment fails if the
pom.xmlcontains three or more${}variable references (even in comments). If there are two or fewer, the deploy succeeds, but the variables are not resolved in the uploaded.pomfile. This breaks standard Maven property usage and prevents correct artifact publishing.Troubleshooting and Observations
${}: Deploy fails,.pomis not uploaded.${}: Deploy succeeds, but variables remain unresolved in the uploaded.pom.Example POMs
Fails to Deploy (3
${}references)Deploys, but Variables Not Resolved (2
${}references)Realistic Example from pom-wip.xml
Nexus Audit Log Snippets
Failed Upload (with property variables)
Successful Upload (with hardcoded versions)
Impact
Steps to Reproduce
${}references (even in comments).mvn deployto Nexus..pomfile is not uploaded.${}and deploy again; upload succeeds but variables are not resolved.Environment
Request