Add version and supported specification information into JAR manifiest
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 16 Sep 2008 09:33:30 +0000 (09:33 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 16 Sep 2008 09:33:30 +0000 (09:33 +0000)
Add version class that allows you to execute the library JAR and get the library version number

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2762 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

doc/RELEASE-NOTES.txt [moved from doc/RELEASE_NOTES.txt with 92% similarity]
pom.xml
src/main/java/edu/internet2/middleware/shibboleth/idp/Version.java

similarity index 92%
rename from doc/RELEASE_NOTES.txt
rename to doc/RELEASE-NOTES.txt
index 3906793..f308965 100644 (file)
@@ -23,4 +23,5 @@ Changes in Release 2.1.0
 [SIDP-206] - SessionManagerEntry's back reference to the SessionManager object interferes with clustering
 [SIDP-209] - Enforce SAML 2 metadata SPSSODescriptor/@AuthnRequestsSigned
 [SIDP-214] - Installer needs to put (at least) bcprov onto the calsspath before it runs ant
-[SIDP-222] - Template engine used by LDAP and database connectors throw an NPE on startup
\ No newline at end of file
+[SIDP-222] - Template engine used by LDAP and database connectors throw an NPE on startup
+[SIDP-224] - Add version information in library JAR manifest and provide command line tool to view it
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 07219ac..9ccdbbe 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <index>true</index>
+                        <manifestEntries>
+                            <Main-Class>edu.internet2.middleware.shibboleth.idp.Version</Main-Class>
+                        </manifestEntries>
+                        <manifestSections>
+                            <manifestSection>
+                                <name>edu/internet2/middleware/shibboleth/idp/</name>
+                                <manifestEntries>
+                                    <Implementation-Title>${pom.artifactId}</Implementation-Title>
+                                    <Implementation-Version>${pom.version}</Implementation-Version>
+                                    <Implementation-Vendor>www.opensaml.org</Implementation-Vendor>
+                                </manifestEntries>
+                            </manifestSection>
+                        </manifestSections>
+                    </archive>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
index 8af9c78..c893709 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ * Copyright 2008 University Corporation for Advanced Internet Development, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package edu.internet2.middleware.shibboleth.idp;
 
-/**
- * Application that outputs the current IdP version.
- */
-public final class Version {
-
-    /** Current IdP version. */
-    public static final String VERSION = "$IDP_VERSION$";
-
-    /** Constructor. */
-    private Version() {
-
-    }
+/** Class for printing the version of this library. */
+public class Version {
 
     /**
-     * Application entry point.
+     * Main entry point to program.
      * 
      * @param args command line arguments
      */
     public static void main(String[] args) {
-        System.out.println("Shibboleth Identity Provider Version: " + VERSION);
+        Package pkg = Version.class.getPackage();
+        System.out.println(pkg.getImplementationTitle() + " version " + pkg.getImplementationVersion());
     }
 }
\ No newline at end of file