Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

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

Open
dkirrane opened this issue Dec 22, 2016 · 8 comments
Open

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

dkirrane opened this issue Dec 22, 2016 · 8 comments

Comments

@dkirrane
Copy link

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.

@bdemers
Copy link
Owner

bdemers commented Dec 22, 2016

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

@dkirrane
Copy link
Author

dkirrane commented Dec 23, 2016

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

@bdemers
Copy link
Owner

bdemers commented Dec 23, 2016

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

@nickcodefresh
Copy link

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

@bdemers
Copy link
Owner

bdemers commented Jan 30, 2017

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.

nickcodefresh added a commit to nickcodefresh/maven-external-version that referenced this issue Feb 15, 2017
…rder to demonstrate incorrect ${project.version} resolution (bdemers#7)
@nickcodefresh
Copy link

nickcodefresh commented Feb 15, 2017

I've created pull request #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.

@amirdt22
Copy link

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>

inodb added a commit to inodb/cbioportal that referenced this issue Dec 6, 2018
Uses slightly modified maven-external-version plugin to generate the project
version from git describe. This avoids having to change the pom version in a
separate PR.

Unfortunately ${project.version} doesn't work in plugins, so we can't show the
version name in the actual war file name anymore (this is a known issue:
bdemers/maven-external-version#7). Seems like an ok
trade-off to me though, I usually run with -Dfinal.war.name=cbioportal anyway.
inodb added a commit to inodb/cbioportal that referenced this issue Dec 6, 2018
Uses slightly modified maven-external-version plugin to generate the project
version from git describe. This avoids having to change the pom version in a
separate PR.

Unfortunately ${project.version} doesn't work in plugins, so we can't show the
version name in the actual war file name anymore (this is a known issue:
bdemers/maven-external-version#7). Seems like an ok
trade-off to me though, I usually run with -Dfinal.war.name=cbioportal anyway.
inodb added a commit to inodb/cbioportal that referenced this issue Dec 6, 2018
Uses slightly modified maven-external-version plugin to generate the project
version from git describe. This avoids having to change the pom version in a
separate PR.

Unfortunately ${project.version} doesn't work in plugins, so we can't show the
version name in the actual war file name anymore (this is a known issue:
bdemers/maven-external-version#7). Seems like an ok
trade-off to me though, I usually run with -Dfinal.war.name=cbioportal anyway.
inodb added a commit to inodb/cbioportal that referenced this issue Dec 7, 2018
Uses slightly modified maven-external-version plugin to generate the project
version from git describe. This avoids having to change the pom version in a
separate PR.

Unfortunately ${project.version} doesn't work in plugins, so we can't show the
version name in the actual war file name anymore (this is a known issue:
bdemers/maven-external-version#7). Seems like an ok
trade-off to me though, I usually run with -Dfinal.war.name=cbioportal anyway.
@inodb
Copy link

inodb commented Dec 7, 2018

@nickcodefresh here are some quick fixes that might solve your issue.

This updates versions in dependencies:

cBioPortal@088797c

This updates versions in build plugins:

f09c2b9

You can include it in your project through jitpack, see e.g.:

cBioPortal/cbioportal#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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants