maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bayne <...@threerings.net>
Subject Embed project version in archetype
Date Fri, 26 Aug 2011 16:08:30 GMT
Hi,

I'm creating a Maven archetype which generates a project skeleton that 
will include a dependency on the project from which the archetype 
originated.

For example, the origin project looks like:

origin/archetype/... archetype for generating project
       /core/... core services
       /extra/... extra services

and the archetype will generate a project with a POM that contains 
dependencies like so:

   <dependencies>
     <dependency>
       <groupId>com.foo</groupId>
       <artifactId>origin-core</artifactId>
       <version>SOMEVERSION</code>
     </dependency>
   </dependencies>

I want SOMEVERSION to be the version of the origin project at the time 
that the archetype is built and installed into the repository.

So if the origin project is at version 1.0-SNAPSHOT and is "mvn 
install"ed, then I want the archetype to generate a dependency on 
1.0-SNAPSHOT. And when the origin project is released, and automatically 
bumped to version 1.0, I want the archetype to generate a dependency on 
origin-core 1.0.

Basically I'd like to use ${archetypeVersion} as a Velocity variable in my 
POM, but that doesn't seem possible.

Is there any other way of accomplishing what I'm trying to do here? Does 
everyone who generates dependencies in their artifacts just manually hack 
them every time they do a project release?

Thanks,

Michael

-- mdb@threerings.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message