0

I have a modular maven project for which I'm using the mvn:release plugin to handle versioning and scm tags. After each release every module and the root pom.xml is deployed to an artifactory repository, from which at a later moment I'd like to be able to retrieve them. My problem is that version information gets lost as soon as the artifacts are deployed to the repository, there's no way to know which version of the modules compose a specific version of the parent project. Of course I could just checkout the scm tag and do a rebuild, but that seems wasteful, so I was wondering if there's another way. I could easily (in fact I have) create a simple script to run during the build to save version information in a text file along with build, but I can't seem to find a way to deploy that file to the repository along with the root pom.xml.

Any ideas?

agnul
  • 12,608
  • 14
  • 63
  • 85

1 Answers1

1

Well, You could use the maven resources plugin to filter some resource with the version numbers you need.

That would give you a property file in a target directory, and you can subsequently append that as an artefact to the build by using the buildhelper plugin and the attach-artifact goal.

Do you get the idea or should I be more specific?

Niels Bech Nielsen
  • 4,777
  • 1
  • 21
  • 44
  • I didn't think of copying/filtering resources, but the attach-artifact plugin did the trick, thanks! – agnul Aug 07 '14 at 08:22