maven-external-version
maven-external-version copied to clipboard
${project.version} variable not updated in plugin config
I've tried maven-external-version with a pom containing a few plugins like {{maven-dependency-plugin}} {{maven-antrun-plugin}} and {{exec-maven-plugin}}
If any of the plugins have ${project.version} in the configuration it will not get updated with the new version. Is there a way around this or am I missing something.
I'm not sure I follow, ${project.version} should not be updated, only static versions should be. (unless I'm miss understanding the question)
Hi,
I created a sample project here that uses a simple ant task to copy the built jar. It uses ${project.version} as the path for file to copy. It fails cause version is changed but property hasn't.
https://github.com/dkirrane/my-project.git
You can run with Maven wrapper
./mvnw clean install
AHHH, I see, since this is a single execution of maven, it is possible that the property isn't getting interpolated in the context of plugins
I have this same problem, and is a major stumbling block for us.
OH, I see, you mean the runtime property, not the interpolated one. Any chance you can add a test case? It should be pretty easy to fix after that.
I've created pull request https://github.com/bdemers/maven-external-version/pull/8 in which I've updated the existing multi-module test to demonstrate this issue. What I did was to add a dependency between the level-one module and the level-three module in the multi-moule project.
I bumped into this as well. Would it be easy to just expose a new property that can be used?
...Some other plugin
<imageTags>${project.external-version}</imageTags>
@nickcodefresh here are some quick fixes that might solve your issue.
This updates versions in dependencies:
https://github.com/cBioPortal/maven-external-version/commit/088797cbcb430e18047fa2345c41b0054bbd03d1
This updates versions in build plugins:
https://github.com/bdemers/maven-external-version/commit/f09c2b9608744881111f24e55d55a91e54e6cb5f
You can include it in your project through jitpack, see e.g.:
https://github.com/cBioPortal/cbioportal/pull/5403
It prolly isn't too hard to add properties as well to the new pom file if that's what you prefer, but haven't tried that.