-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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,.pomis not uploaded. - 2 or fewer
${}: Deploy succeeds, but variables remain unresolved in the uploaded.pom.
- 3+
- 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 deployto Nexus. - Observe that the
.pomfile 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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working