[java-opensaml COMMIT] in /trunk/opensaml-core: pom.xml src/main/java/org/opensaml/core/xml/Version.java

noreply at shibboleth.net noreply at shibboleth.net
Thu Sep 25 19:45:37 EDT 2014


Author: putmanb
Date: Thu Sep 25 19:45:36 2014
New Revision: 4075

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4075&view=rev
Log:
OSJ-91: org.opensaml.core.xml.Version is currently broken

Modified:
    trunk/opensaml-core/pom.xml
    trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Version.java

Modified: trunk/opensaml-core/pom.xml
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/pom.xml?rev=4075&r1=4074&r2=4075&view=diff
==============================================================================
--- trunk/opensaml-core/pom.xml (original)
+++ trunk/opensaml-core/pom.xml Thu Sep 25 19:45:36 2014
@@ -29,5 +29,31 @@
         <!-- Test Dependencies -->
 
     </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <index>true</index>
+                        <manifestEntries>
+                            <Main-Class>org.opensaml.core.xml.Version</Main-Class>
+                        </manifestEntries>
+                        <manifestSections>
+                            <manifestSection>
+                                <name>org/opensaml/core/xml/</name>
+                                <manifestEntries>
+                                    <Implementation-Title>${project.artifactId}</Implementation-Title>
+                                    <Implementation-Version>${project.version}</Implementation-Version>
+                                    <Implementation-Vendor>opensaml.org</Implementation-Vendor>
+                                </manifestEntries>
+                            </manifestSection>
+                        </manifestSections>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

Modified: trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Version.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Version.java?rev=4075&r1=4074&r2=4075&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Version.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/core/xml/Version.java Thu Sep 25 19:45:36 2014
@@ -17,23 +17,13 @@
 
 package org.opensaml.core.xml;
 
+import javax.annotation.Nullable;
+
 /** Class for printing the version of this library. */
 public final class Version {
 
-    /** Name of the library. */
-    private static final String NAME;
-
-    /** Library version. */
-    private static final String VERSION;
-
-    /** Library major version number. */
-    private static final int MAJOR_VERSION;
-
-    /** Library minor version number. */
-    private static final int MINOR_VERSION;
-
-    /** Library micro version number. */
-    private static final int MICRO_VERSION;
+    /** IdP version. */
+    @Nullable private static final String VERSION = Version.class.getPackage().getImplementationVersion();
 
     /** Constructor. */
     private Version() {
@@ -45,61 +35,16 @@
      * @param args command line arguments
      */
     public static void main(String[] args) {
-        System.out.println(NAME + " version " + VERSION);
+        System.out.println(VERSION);
     }
 
     /**
-     * Gets the name of the library.
-     * 
-     * @return name of the library
-     */
-    public static String getName() {
-        return NAME;
-    }
-
-    /**
-     * Gets the version of the library.
+     * Get the version of the library.
      * 
      * @return version of the library
      */
-    public static String getVersion() {
+    @Nullable public static String getVersion() {
         return VERSION;
     }
-
-    /**
-     * Gets the major version number of the library.
-     * 
-     * @return major version number of the library
-     */
-    public static int getMajorVersion() {
-        return MAJOR_VERSION;
-    }
-
-    /**
-     * Gets the minor version number of the library.
-     * 
-     * @return minor version number of the library
-     */
-    public static int getMinorVersion() {
-        return MINOR_VERSION;
-    }
-
-    /**
-     * Gets the micro version number of the library.
-     * 
-     * @return micro version number of the library
-     */
-    public static int getMicroVersion() {
-        return MICRO_VERSION;
-    }
-
-    static {
-        Package pkg = Version.class.getPackage();
-        NAME = pkg.getImplementationTitle().intern();
-        VERSION = pkg.getImplementationVersion().intern();
-        String[] versionParts = VERSION.split("\\.");
-        MAJOR_VERSION = Integer.parseInt(versionParts[0]);
-        MINOR_VERSION = Integer.parseInt(versionParts[1]);
-        MICRO_VERSION = Integer.parseInt(versionParts[2]);
-    }
+    
 }



More information about the commits mailing list