Hi Mark,
Mark Eggers wrote:
> Folks,
>
> I have a requirement to do the following:
>
> 1. grab the version of a particular artifact
> 2. place that via into a file visible in the final build
>
> I was thinking of using the resources plugin to do this. However, I
> can't seem to find the property to reference that points to a version of
> a particular dependency.
>
> What I fell back to is the following:
>
> <properties>
> <importantArtifactVersion>1.2.3</importantArtifactVersion>
> </properties>
>
> <depenedencies>
> <dependency>
> <groupId>some.org</groupId>
> <artifactId>importantArtifact<artifactId>
> <version>${importantArtifactVersion</version>
> </dependency>
> </dependencies>
>
> Then in the file to be filtered:
>
> ImportantArtifact: ${importantArtifactVersion}
>
> This all works fine, and as a bonus makes things easier to update when
> versions are bumped.
>
> However, how will this impact the eventual use of the release plugin?
> Will the release plugin look at a dependency, find the version is a
> property, look for the property and increment that?
>
> If not, what is a good way of meeting this requirement (other than tell
> someone to read the POM or site for a particular released version).
Apart from the fact that you're using the property elsewhere, it is quite
common to define the versions of all dependencies and plugins in separate
properties like you did. Those properties are used then typically in a
dependencyManagement or pluginManagement section. The only versions that you
will normally never define with properties are the current version of your
project and the version of your parent.
One big advantage is also, that you can try out from command line a
different version of a dependency or plugin for your build ... sim,ply
define the property as system property to override the one in the POM.
> . . . still a Maven newbie
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]