Introduction

Why JReleaseInfo

Sometimes you are interested at runtime to have information from build time. This may be the build date of the program, a build number or the version.

Generation of the infofile

The JReleaseInfo AntTask and the JReleaseInfo Maven Plugin generate a java source file with getter methods for the desired properties of the form (e.g. for a version property):

   /**
    * Get version (set during build process to "1.0.0")
    * @return String version
    */
   public static final String getVersion() { return "1.0.0"; }
				

With a flag ("withViewer") java code for a Swing- or TextViewer and a main() method is embedded. This allows to show the content of the JReleaseInfo-File. This is usefull for libraries, which normally do not have a Main-Class defined in the jar-manifest.

Usage of JReleaseInfo

If a viewer is embedded, the call of

	java -jar mylibrary.jar -t
				

shows the properties stored in the information file as textoutput in a console.

If in a graphical environment the parameter -t is left away or if the JAR-File is opened with a mouse double click, a window with the same information will be opened:

JReleaseInfo-Viewer