Summary
When a project uses CI-friendly versions (${revision} property in <version>), Maven 4's PomInlinerTransformer fails with IllegalArgumentException: Cannot inline property revision.
Reproduction
Projects affected (found in maven4-testing rc-6 run):
Both use ${revision} in their <version> element and work fine with Maven 3.
Stack trace
java.lang.IllegalArgumentException: Cannot inline property revision
at org.apache.maven.internal.transformation.impl.PomInlinerTransformer.lambda$injectTransformedArtifacts$1(PomInlinerTransformer.java:130)
at org.apache.maven.impl.model.DefaultInterpolator.resolveVariable(DefaultInterpolator.java:381)
at org.apache.maven.impl.model.DefaultInterpolator.processSubstitution(DefaultInterpolator.java:306)
at org.apache.maven.impl.model.DefaultInterpolator.doSubstVars(DefaultInterpolator.java:268)
at org.apache.maven.impl.model.DefaultInterpolator.substVars(DefaultInterpolator.java:203)
at org.apache.maven.impl.model.DefaultInterpolator.interpolate(DefaultInterpolator.java:83)
Expected behavior
CI-friendly version properties (${revision}, ${sha1}, ${changelist}) should be correctly inlined when generating the consumer POM — the same way they are when set on the command line via -Drevision=1.0.0.
Actual behavior
Build fails with Cannot inline property revision.
Maven version
Maven 4.0.0-rc-6 / maven-4.0.x branch
Summary
When a project uses CI-friendly versions (
${revision}property in<version>), Maven 4'sPomInlinerTransformerfails withIllegalArgumentException: Cannot inline property revision.Reproduction
Projects affected (found in maven4-testing rc-6 run):
Both use
${revision}in their<version>element and work fine with Maven 3.Stack trace
Expected behavior
CI-friendly version properties (
${revision},${sha1},${changelist}) should be correctly inlined when generating the consumer POM — the same way they are when set on the command line via-Drevision=1.0.0.Actual behavior
Build fails with
Cannot inline property revision.Maven version
Maven 4.0.0-rc-6 / maven-4.0.x branch