
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
1.
MNG-maven-install.patch (12 kB)
2.
MNG-maven-install.patch (11 kB)
|
|
Environment:
|
independent
|
|
Issue Links:
|
Duplicate
|
|
This issue duplicates:
|
|
MNG-3057
properties not expanded in generated POMs when building A/B/C nested projects
|
|
|
|
|
|
Related
|
|
|
|
This issue is related to:
|
|
|
MNG-624 automatic parent versioning
|
|
|
|
|
dependent
|
|
|
|
This issue is depended upon by:
|
|
|
MNG-2971 Variables are not replaced into installed pom file
|
|
|
|
|
|
|
| Testcase included: |
yes
|
| Patch Submitted: |
Yes
|
When maven installs an artifact, it's pom is also copied into the artifact's directory. Unfortunately, if the pom contains a property reference (e.g. ${myprop}), this will not be replaced upon copying the pom file.
I've created a patch for the install plugin that switches on property filtering by setting a mojo parameter "filteringEnabled". Since this defaults to "false", backward compatibility is kept 100%.
Some implementation notes:
- the dirty work is done in FilteredProjectArtifactMetadata.java, the property resolution code has been inspired by ResourcesMojo.
- I've added a unit test, that replaces ${basedir} with the value of a system property.
- since "svn diff" does not handle binary files, src/test/resources/unit/basic-install-test-with-filtering/target/maven-install-test-1.0-SNAPSHOT.jar is not included in the patch. This file is the same as
src/test/resources/unit/basic-install-test/target/maven-install-test-1.0-SNAPSHOT.jar
Since my knowledge of Maven API is more than limited, there might be a more elegant way to provide this feature ... but it works! I'd be happy to see this in a future release of maven.
|
|
Description
|
When maven installs an artifact, it's pom is also copied into the artifact's directory. Unfortunately, if the pom contains a property reference (e.g. ${myprop}), this will not be replaced upon copying the pom file.
I've created a patch for the install plugin that switches on property filtering by setting a mojo parameter "filteringEnabled". Since this defaults to "false", backward compatibility is kept 100%.
Some implementation notes:
- the dirty work is done in FilteredProjectArtifactMetadata.java, the property resolution code has been inspired by ResourcesMojo.
- I've added a unit test, that replaces ${basedir} with the value of a system property.
- since "svn diff" does not handle binary files, src/test/resources/unit/basic-install-test-with-filtering/target/maven-install-test-1.0-SNAPSHOT.jar is not included in the patch. This file is the same as
src/test/resources/unit/basic-install-test/target/maven-install-test-1.0-SNAPSHOT.jar
Since my knowledge of Maven API is more than limited, there might be a more elegant way to provide this feature ... but it works! I'd be happy to see this in a future release of maven. |
Show » |
Sort Order:
|
Is there a reason why you do not apply this filtering to artifacts of type "pom" ?