maven-external-version icon indicating copy to clipboard operation
maven-external-version copied to clipboard

${project.version} variable not updated in plugin config

Open dkirrane opened this issue 8 years ago • 8 comments
trafficstars

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.

dkirrane avatar Dec 22 '16 12:12 dkirrane

I'm not sure I follow, ${project.version} should not be updated, only static versions should be. (unless I'm miss understanding the question)

bdemers avatar Dec 22 '16 15:12 bdemers

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

dkirrane avatar Dec 23 '16 13:12 dkirrane

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

bdemers avatar Dec 23 '16 14:12 bdemers

I have this same problem, and is a major stumbling block for us.

nickcodefresh avatar Jan 30 '17 08:01 nickcodefresh

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.

bdemers avatar Jan 30 '17 17:01 bdemers

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.

nickcodefresh avatar Feb 15 '17 09:02 nickcodefresh

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>

amirdt22 avatar Jan 19 '18 00:01 amirdt22

@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.

inodb avatar Dec 07 '18 21:12 inodb