Browse Source

build enhancements

Jason Rivard 5 years ago
parent
commit
a695d982bb

+ 12 - 5
pom.xml

@@ -60,6 +60,12 @@
                 <checkstyle.skip>true</checkstyle.skip>
             </properties>
         </profile>
+        <profile>
+            <id>skip-spotbugs</id>
+            <properties>
+                <spotbugs.skip>true</spotbugs.skip>
+            </properties>
+        </profile>
         <profile>
             <id>enable-javadoc</id>
             <properties>
@@ -136,9 +142,6 @@
                                     <Implementation-URL>${project.organization.url}</Implementation-URL>
                                     <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
                                     <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
-                                    <Implementation-Build>${build.number}</Implementation-Build>
-                                    <Implementation-Revision>${build.revision}</Implementation-Revision>
-                                    <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
                                     <SCM-Git-Branch>${git.branch}</SCM-Git-Branch>
                                     <SCM-Git-Commit-ID>${git.commit.id}</SCM-Git-Commit-ID>
                                     <SCM-Git-Commit-ID-Abbrev>${git.commit.id.abbrev}</SCM-Git-Commit-ID-Abbrev>
@@ -313,6 +316,7 @@
                     </dependency>
                 </dependencies>
                 <configuration>
+                    <skip>${spotbugs.skip}</skip>
                     <fork>false</fork>
                     <excludeFilterFile>${project.root.basedir}/build/spotbugs-exclude.xml</excludeFilterFile>
                     <includeTests>false</includeTests>
@@ -320,7 +324,7 @@
                 </configuration>
                 <executions>
                     <execution>
-                        <phase>verify</phase>
+                        <phase>test</phase>
                         <goals>
                             <goal>check</goal>
                         </goals>
@@ -333,14 +337,17 @@
                 <version>1.8</version>
                 <executions>
                     <execution>
+                        <id>output-checksums</id>
                         <goals>
                             <goal>artifacts</goal>
                         </goals>
-                        <phase>verify</phase>
+                        <phase>package</phase>
                         <configuration>
                             <algorithms>
                                 <algorithm>SHA-1</algorithm>
+                                <algorithm>SHA-256</algorithm>
                             </algorithms>
+                            <failOnError>false</failOnError>
                         </configuration>
                     </execution>
                 </executions>

+ 0 - 3
server/pom.xml

@@ -116,9 +116,6 @@
                             <Implementation-URL>${project.organization.url}</Implementation-URL>
                             <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
                             <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
-                            <Implementation-Build>${build.number}</Implementation-Build>
-                            <Implementation-Revision>${build.revision}</Implementation-Revision>
-                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
                             <SCM-Git-Branch>${git.branch}</SCM-Git-Branch>
                             <SCM-Git-Commit-ID>${git.commit.id}</SCM-Git-Commit-ID>
                             <SCM-Git-Commit-ID-Abbrev>${git.commit.id.abbrev}</SCM-Git-Commit-ID-Abbrev>

+ 4 - 16
server/src/main/java/password/pwm/PwmConstants.java

@@ -51,26 +51,14 @@ public abstract class PwmConstants
 {
     public static final Map<String, String> BUILD_MANIFEST = readBuildManifest();
 
-    public static final String BUILD_TIME = BUILD_MANIFEST.getOrDefault( "Implementation-Build-Timestamp", "n/a" );
-    public static final String BUILD_NUMBER = BUILD_MANIFEST.getOrDefault( "Implementation-Build", "0" );
-    public static final String BUILD_REVISION = BUILD_MANIFEST.getOrDefault( "Implementation-Revision", "0" );
+    public static final String BUILD_TIME = BUILD_MANIFEST.getOrDefault( "SCM-Git-Commit-Timestamp", "n/a" );
+    public static final String BUILD_NUMBER = BUILD_MANIFEST.getOrDefault( "SCM-Git-Commit-ID-Abbrev", "0" );
+    public static final String BUILD_REVISION = BUILD_MANIFEST.getOrDefault( "SCM-Git-Commit-ID", "0" );
     public static final String BUILD_JAVA_VENDOR = BUILD_MANIFEST.getOrDefault( "Implementation-Build-Java-Vendor", "0" );
     public static final String BUILD_JAVA_VERSION = BUILD_MANIFEST.getOrDefault( "Implementation-Build-Java-Version", "0" );
     public static final String BUILD_VERSION = BUILD_MANIFEST.getOrDefault( "Implementation-Version", "0" );
 
-    private static final String MISSING_VERSION_STRING = readPwmConstantsBundle( "missingVersionString" );
-    public static final String SERVLET_VERSION;
-
-    static
-    {
-        final String servletVersion = "v" + BUILD_VERSION
-                        + " b" + BUILD_NUMBER
-                        + " r" + BUILD_REVISION;
-
-        SERVLET_VERSION = servletVersion.isEmpty()
-                ? MISSING_VERSION_STRING
-                : servletVersion;
-    }
+    public static final String SERVLET_VERSION = "v" + BUILD_VERSION  + " b" + BUILD_NUMBER;
 
     public static final String CHAI_API_VERSION = com.novell.ldapchai.ChaiConstant.CHAI_API_VERSION;
 

+ 6 - 0
server/src/main/java/password/pwm/http/servlet/admin/AppDashboardData.java

@@ -193,6 +193,12 @@ public class AppDashboardData implements Serializable
                 l.forKey( "Field_AppVersion", PwmConstants.PWM_APP_NAME ),
                 PwmConstants.SERVLET_VERSION
         ) );
+        aboutData.add( new DisplayElement(
+                "appBuildTime",
+                DisplayElement.Type.timestamp,
+                l.forKey( "Field_AppBuildTime" ),
+                PwmConstants.BUILD_TIME
+        ) );
         aboutData.add( new DisplayElement(
                 "currentTime",
                 DisplayElement.Type.timestamp,

+ 8 - 4
server/src/main/java/password/pwm/util/JarMain.java

@@ -23,6 +23,7 @@ package password.pwm.util;
 import password.pwm.PwmConstants;
 
 import javax.swing.JOptionPane;
+import java.util.Map;
 
 
 public class JarMain
@@ -47,10 +48,13 @@ public class JarMain
         sb.append( "\n" );
         sb.append( "Build Information: \n" );
 
-        sb.append( "build.time=" + PwmConstants.BUILD_TIME + "\n" );
-        sb.append( "build.number=" + PwmConstants.BUILD_NUMBER + "\n" );
-        sb.append( "build.java.version=" + PwmConstants.BUILD_JAVA_VERSION + "\n" );
-        sb.append( "build.java.vendor=" + PwmConstants.BUILD_JAVA_VENDOR + "\n" );
+        for ( final Map.Entry<String, String> entry : PwmConstants.BUILD_MANIFEST.entrySet() )
+        {
+            sb.append( entry.getKey() );
+            sb.append( "=" );
+            sb.append( entry.getValue() );
+            sb.append( "\n" );
+        }
 
         sb.append( "\n" );
         sb.append( "Reference URL: " + PwmConstants.PWM_URL_HOME + "\n" );

+ 0 - 1
server/src/main/resources/password/pwm/PwmConstants.properties

@@ -38,6 +38,5 @@ paramName.token=token
 defaultConfigFilename=PwmConfiguration.xml
 defaultPropertiesConfigFilename=silent.properties
 enableEulaDisplay=false
-missingVersionString=[Version Missing]
 applicationPathInfoFile=applicationPath.properties
 includedLocales=["","en_CA","ca","cs","da","de","el","es","fi","fr","fr_CA","hu","it","iw","ja","ko","nl","nn","no","pl","pt","pt_BR","sk","sv","th","tr","zh_CN","zh_TW"]

+ 1 - 0
server/src/main/resources/password/pwm/i18n/Admin.properties

@@ -334,6 +334,7 @@ Title_URLReference=URL Reference
 MenuItem_ConfigEditor=Configuration Editor
 MenuItem_ConfigManager=Configuration Manager
 Field_AppVersion=%1% Version
+Field_AppBuildTime=Build Time
 Field_CurrentPubVersion=Current Published Version
 Field_UpTime=Up Time
 Field_SiteURL=Site URL