I use bash shell to build our web archive (WAR) file for deployment. It is very useful for the version as defined from Git repository tagging to be available from the WAR manifest to determine the origin of the WAR. Via the shell script, it looks like this...
export TAGGEDVERSION="`git describe --tags --abbrev=0`"
export SIGNATURE="`git describe --tags --abbrev=0`:`git rev-parse --abbrev-ref HEAD`:`git rev-parse --short=11 HEAD`"
mvn "-Dbuild.number=${SIGNATURE}" "-Dbuild.version=${TAGGEDVERSION}" clean package
These values correlate with our POM to set the manifest...
<manifestEntries>
<MyApp-Version>${build.version}</MyApp-Version>
<MyApp-BuildNumber>${build.number}</MyApp-BuildNumber>
<MyApp-BuildTimestamp>${maven.build.timestamp}</MyApp-BuildTimestamp>
</manifestEntries>
I can then query the manifest...
unzip -q -c target/application.war META-INF/MANIFEST.MF
...and see where it came from...
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: jDoe
Build-Jdk: 1.8.0_251
MyApp-BuildNumber: 5.1.0rc2:HLP-2993:bac98886a53
MyApp-BuildTimestamp: 2020-07-01T14:57:41Z
MyApp-Version: 5.1.0rc2
But the majority of our developers use Eclipse to build and test, which I am unfamiliar with.
How can I do the equivalent settings from Git through Maven to the manifest using Eclipse?