Here is the technique I use on OpenEJB. Note the version here is
hardcoded cause at the time ${pom.currentVersion} didn't work. They
may have fixed that since. Anyway, at runtime we just read this file
out of the classpath. Geronimo adopted the same technique.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<tstamp/>
<replace file="target/classes/openejb-
version.properties"
token="@VERSION-REPLACED-BY-MAVEN@"
value="3.0-SNAPSHOT"/>
<replace file="target/classes/openejb-
version.properties"
token="@DATE-REPLACED-BY-MAVEN@"
value="${DSTAMP}"/>
<replace file="target/classes/openejb-
version.properties"
token="@TIME-REPLACED-BY-MAVEN@"
value="${TSTAMP}"/>
<!-- Add *.properties files -->
<copy todir="target/classes">
<fileset dir="src/main/java">
<include name="**/*.properties"/>
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
On Aug 14, 2006, at 2:00 PM, Patrick Linskey wrote:
Hi,
I think it'd be nice if each of the modules could encode svn revision
number and OpenJPA version number information into the built jars,
presumably in a manifest entry. Does anyone have any knowledge
about how
to coerce this type of info into jars in a mvn environment?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
______________________________________________________________________
_
Notice: This email message, together with any attachments, may
contain
information of BEA Systems, Inc., its subsidiaries and
affiliated
entities, that may be confidential, proprietary, copyrighted
and/or
legally privileged, and is intended solely for the use of the
individual
or entity named in this message. If you are not the intended
recipient,
and have received this message in error, please immediately return
this
by email and then delete it.