Hi Mark - I've added my "artifact properties" plugin to sourceforge and
the sonatype snapshot repository.

Project URL: https://sourceforge.net/projects/artifactpropertyplugin/
SVN code: https://svn.code.sf.net/p/artifactpropertyplugin/code/trunk
Snapshot:
https://oss.sonatype.org/content/repositories/snapshots/com/idfconnect/dev
tools/artifact-property-plugin/1.0-SNAPSHOT/artifact-property-plugin-1.0-2
0130930.040133-2.jar

For every resolved compile+runtime dependency, the plug-in will set the
following properties:

- the version of the artifact:
"artifact.<groupId>.<artifactId>[.<classifier>].<type>.<version>"
- the file name of the artifact:
"artifact.<groupId>.<artifactId>[.<classifier>].<type>.<filename>"

These properties are then available for use in other plugins, such as the
Codehaus template plugin, which can insert property values into tokens in
project files.

Let me know if you find it useful...

Best regards,

Richard

-----Original Message-----
From: Mark Eggers [mailto:[email protected]]
Sent: Sunday, September 29, 2013 5:55 PM
To: Maven Users List
Subject: Re: Obtain a dependency version for output in resource filtering

On 9/29/2013 2:26 PM, Richard Sand wrote:
> Hi Mark- I posted the same exact question a few weeks ago and was told
> I was being unmaven... :-)
>
> I wrote a plugin to do exactly what you're asking- ill put it on
> sourceforge this week.
>
> Sent from my iPad
>
> On Sep 29, 2013, at 2:24 PM, Mark Eggers <[email protected]>
> 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).
>>
>> . . . still a Maven newbie

Yep, I agree that it's un-Maven. I'm not happy about the requirement.
However, this is what is currently in use with the ant-based build
scripts. Until I can get a better software release management system in
place, I'll have to live with the requirement.

. . . . just my two cents
/mde/

- sorry about the copious amount of typos in the previous message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to