On Sunday 06 May 2007 17:30, Howard Lewis Ship wrote:
> I have a project with multiple modules.
>
> I'm keeping the version numbers synced.
>
> This ends up with a lot of repetition of the version number:
>
> <artifactId>tapestry-core</artifactId>
> <packaging>jar</packaging>
> <version>5.0.5-SNAPSHOT</version>
> <parent>
> <groupId>org.apache.tapestry</groupId>
> <artifactId>tapestry-project</artifactId>
> <version>5.0.5-SNAPSHOT</version>
> <relativePath>../tapestry-project/pom.xml</relativePath>
> </parent>
>
>
> Worse yet, those same version numbers are creeping into documentation and
> into project archetypes.
>
> How would I go about externalizing the version number so that it appears
> just once? I'd love to have something like I used to do in Ant ... a
> build.properties file that defines the version number.
>
> Also, is there a general way to include POM properties inside APT documents
> and/or site.xml?
What we do here, is define a parent-POM which holds the version-number. All
child-projects to this POM, must at least define the version for the
parent-project, but from there on, you don't need to define them anymore.
Example:
<project>
<parent>
<groupId>my.group</groupId>
<artifactId>parent-artifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>artifact</artifactId>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>another-artifact</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
This project references the parent over a version, inherits that version as
its own version and even uses it to reference another child-project as a
dependency (with that same version again).
Now, if you were to use the release-plugin, you'd never have to change
anything here (unless you explicitly want to use another version of a
parent/dependency).
--
Roland Asmann
CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien
Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: [EMAIL PROTECTED]
Web: www.cfc.at
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]