Java Version Maven

There are two cases:

  1. Java Version within the Manifest for a standalone Executable Jar. That is shown below.
  2. Java Version within the Manifest for a WAR file. That is described under Java Version Maven War.


  • Make sure the POM contains the configuration for the required plugins described below under "Plugins Needed".
  • There is jar-with-dependencies.xml that is referenced and needs to be put in place. Where is that place?
  • To build the jar, create a launch that looks like this and execute it:
  • The .jar file will end up in the root of the project. Open it with WinZip? and look for the file.
  • Inside the, you should see the following lines (with information specific to your app):
Manifest-Version: 1.0
      Archiver-Version: Plexus Archiver
      Created-By: Apache Maven
      Built-By: blmdqwc
      Build-Jdk: 1.6.0_04
      Implementation-Title: UserHelperGUI
      Implementation-Version: 0.0.1-SNAPSHOT
      Implementation-Vendor-Id: com.att.eum.pss
      Main-Class: com.att.eum.pss.uh.UserHelperGUI
      Implementation-Build: 4@2009/07/15 15:04:29

Plugins Needed

Most POMs created from an archetype will not have the plugins or plugin management required to support embedding the version information inside of the Manifest of a jar file as recommended by Sun. This shows the plugins and Plugin Management required.

  • These are the configurations needed for each of the sections. All of the XML below is contained within the <build> section.

Plugin Management


Plugin for compiler


Plugin Buildnumber

            {0,number}@{1,date,yyyy/MM/dd HH:mm:ss}

Assembly Plugin

        <!--   Previous plugin that had been used:
               <artifactId>maven-jar-plugin</artifactId> -->
          <!--  Added to try the assembly -->
          <!-- Tried different options for this value:
            target: works fine command-line, but m2eclipse adds extra path
            to the front of the paths of expanded classes.
            /: works for both command-line and m2eclipse, but the generated
            .jar file ends up in two different locations; m2eclipse as 
            expected, but command-line puts it in the root of the DOS dir.
            ./: works for both and the .jar ends up in the expected dir.  -->
                <!-- Change this to your application's entry point with main() method: -->
            <!--  Messes up the rest of this 
              <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>   -->
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License