You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2021/11/18 17:29:34 UTC

[jspwiki] branch master updated (08cca48 -> c273153)

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git.


    from 08cca48  Update Tomcat to 9.0.55
     new 3065505  JSPWIKI-1180: Ensure JSPWiki builds with JDKs 8, 11 and 17
     new f2b9fe0  SQ issue - rework test so it contains an assertion
     new 724990a  Update Lucene to 8.11.0
     new c273153  2.11.0-git-14

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog.md                                       |  11 ++-
 Jenkinsfile                                        | 100 +++++++++++++--------
 LICENSE                                            |  16 ++--
 .../src/main/java/org/apache/wiki/api/Release.java |   2 +-
 .../java/org/apache/wiki/util/CryptoUtilTest.java  |  61 +++++--------
 pom.xml                                            |   2 +-
 6 files changed, 103 insertions(+), 89 deletions(-)

[jspwiki] 01/04: JSPWIKI-1180: Ensure JSPWiki builds with JDKs 8, 11 and 17

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 3065505c72a88a334ae50dddcc8ff597ac9b4a9f
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Thu Nov 18 18:27:06 2021 +0100

    JSPWIKI-1180: Ensure JSPWiki builds with JDKs 8, 11 and 17
    
    also, mvn invocations use -T 1C to build as concurrently as possible
---
 Jenkinsfile | 100 ++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 61 insertions(+), 39 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index aa88c9b..e91e07a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -23,56 +23,66 @@ creds = '9b041bd0-aea9-4498-a576-9eeb771411dd'
 
 asfsite = 'asf-site'
 build = 'build'
-buildJdk = 'jdk_11_latest'
+buildJdk8 = 'jdk_1.8_latest'
+buildJdk11 = 'jdk_11_latest'
+buildJdk17 = 'jdk_17_latest'
 buildMvn = 'maven_3_latest'
+errMsg = ''
 jbake = 'jbake'
 
 try {
     def pom
 
-    node( 'ubuntu' ) {
-        stage( 'clean ws' ) {
-            cleanWs()
-        }
-
-        stage( 'build source' ) {
-            dir( build ) {
-                git url: buildRepo, poll: true
-                if( env.BRANCH_NAME == 'master' ) {
-                    buildJSPWiki( '-Pattach-additional-artifacts -Djdk.javadoc.doclet.version=2.0.15' )
-                    pom = readMavenPom file: 'pom.xml'
-                    writeFile file: 'target/classes/apidocs.txt', text: 'file created in order to allow aggregated javadoc generation, target/classes is needed for all modules'
-                    writeFile file: 'jspwiki-it-tests/target/classes/apidocs.txt', text: 'file created in order to allow aggregated javadoc generation, target/classes is needed for all modules'
-                    withMaven( jdk: buildJdk, maven: buildMvn, publisherStrategy: 'EXPLICIT' ) {
-                        sh 'mvn package javadoc:aggregate-no-fork -DskipTests -pl !jspwiki-portable -Djdk.javadoc.doclet.version=2.0.14'
-                        sh 'java -cp jspwiki-main/target/classes org.apache.wiki.TranslationsCheck site'
+    stage( "build source" ) {
+        parallel jdk11Build: {
+            node( 'ubuntu' ) {
+                stage( buildJdk11 ) {
+                    cleanWs()
+                    dir( build ) {
+                        git url: buildRepo, poll: true
+                        if( env.BRANCH_NAME == 'master' ) {
+                            buildJSPWiki( '-Pattach-additional-artifacts -Djdk.javadoc.doclet.version=2.0.15' )
+                            pom = readMavenPom file: 'pom.xml'
+                            writeFile file: 'target/classes/apidocs.txt', text: 'file created in order to allow aggregated javadoc generation, target/classes is needed for all modules'
+                            writeFile file: 'jspwiki-it-tests/target/classes/apidocs.txt', text: 'file created in order to allow aggregated javadoc generation, target/classes is needed for all modules'
+                            withMaven( jdk: buildJdk11, maven: buildMvn, publisherStrategy: 'EXPLICIT' ) {
+                                sh 'mvn package javadoc:aggregate-no-fork -DskipTests -pl !jspwiki-portable -Djdk.javadoc.doclet.version=2.0.15'
+                                sh 'java -cp jspwiki-main/target/classes org.apache.wiki.TranslationsCheck site'
+                            }
+                        } else {
+                            buildJSPWiki()
+                        }
                     }
-                } else {
-                    buildJSPWiki()
                 }
-            }
-        }
 
-        stage( 'build website' ) {
-            if( env.BRANCH_NAME == 'master' ) {
-                withMaven( jdk: 'jdk_1.8_latest', maven: buildMvn, publisherStrategy: 'EXPLICIT' ) {
-                    dir( jbake ) {
-                        git branch: jbake, url: siteRepo, credentialsId: creds, poll: false
-                        sh "cp ../$build/ChangeLog.md ./src/main/config/changelog.md"
-                        sh "cp ../$build/i18n-table.txt ./src/main/config/i18n-table.md"
-                        sh "cat ./src/main/config/changelog-header.txt ./src/main/config/changelog.md > ./src/main/jbake/content/development/changelog.md"
-                        sh "cat ./src/main/config/i18n-header.txt ./src/main/config/i18n-table.md > ./src/main/jbake/content/development/i18n.md"
-                        sh 'mvn clean process-resources -Dplugin.japicmp.jspwiki-new=' + pom.version
+                stage( 'build website' ) {
+                    if( env.BRANCH_NAME == 'master' ) {
+                        withMaven( jdk: buildJdk8, maven: buildMvn, publisherStrategy: 'EXPLICIT' ) {
+                            dir( jbake ) {
+                                git branch: jbake, url: siteRepo, credentialsId: creds, poll: false
+                                sh "cp ../$build/ChangeLog.md ./src/main/config/changelog.md"
+                                sh "cp ../$build/i18n-table.txt ./src/main/config/i18n-table.md"
+                                sh "cat ./src/main/config/changelog-header.txt ./src/main/config/changelog.md > ./src/main/jbake/content/development/changelog.md"
+                                sh "cat ./src/main/config/i18n-header.txt ./src/main/config/i18n-table.md > ./src/main/jbake/content/development/i18n.md"
+                                sh 'mvn clean process-resources -Dplugin.japicmp.jspwiki-new=' + pom.version
+                            }
+                            stash name: 'jbake-website'
+                        }
                     }
-                    stash name: 'jbake-website'
                 }
             }
+        },
+        jdk8Build: {
+            reducedBuildWith( buildJdk8 )
+        },
+        jdk17Build: {
+            reducedBuildWith( buildJdk17 )
         }
     }
 
-    node( 'git-websites' ) {
-        stage( 'publish website' ) {
-            if( env.BRANCH_NAME == 'master' ) {
+    stage( 'publish website' ) {
+        if( env.BRANCH_NAME == 'master' ) {
+            node( 'git-websites' ) {
                 cleanWs()
                 unstash 'jbake-website'
                 dir( asfsite ) {
@@ -100,13 +110,14 @@ try {
 } catch( Exception err ) {
     currentBuild.result = 'FAILURE'
     echo err.message
+    errMsg = '- ' + err.message
 } finally {
     node( 'ubuntu' ) {
         if( currentBuild.result == null ) {
             currentBuild.result = 'ABORTED'
         }
         if( env.BRANCH_NAME == 'master' ) {
-            emailext body: "See ${env.BUILD_URL}",
+            emailext body: "See ${env.BUILD_URL} $errMsg",
                      replyTo: 'dev@jspwiki.apache.org',
                      to: 'commits@jspwiki.apache.org',
                      subject: "[${env.JOB_NAME}] build ${env.BUILD_DISPLAY_NAME} - ${currentBuild.result}"
@@ -115,12 +126,23 @@ try {
 }
 
 def buildJSPWiki( buildOpts = '' ) {
-    withMaven( jdk: buildJdk, maven: buildMvn, publisherStrategy: 'EXPLICIT', options: [ jacocoPublisher(), junitPublisher() ] ) {
+    withMaven( jdk: buildJdk11, maven: buildMvn, publisherStrategy: 'EXPLICIT', options: [ jacocoPublisher(), junitPublisher() ] ) {
         withCredentials( [ string( credentialsId: 'sonarcloud-jspwiki', variable: 'SONAR_TOKEN' ) ] ) {
-            def masterBranchOptions = ""
             def sonarOptions = "-Dsonar.projectKey=jspwiki-builder -Dsonar.organization=apache -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN"
             echo 'Will use SonarQube instance at https://sonarcloud.io'
-            sh "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package org.jacoco:jacoco-maven-plugin:report sonar:sonar $sonarOptions $buildOpts"
+            sh "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package org.jacoco:jacoco-maven-plugin:report sonar:sonar $sonarOptions $buildOpts -T 1C"
+        }
+    }
+}
+
+def reducedBuildWith( jdk ) {
+    node( 'ubuntu' ) {
+        stage( jdk ) {
+            cleanWs()
+            git url: buildRepo, poll: true
+            withMaven( jdk: jdk, maven: buildMvn, publisherStrategy: 'EXPLICIT', options: [] ) {
+                sh 'mvn clean package -T 1C'
+            }
         }
     }
 }
\ No newline at end of file

[jspwiki] 04/04: 2.11.0-git-14

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit c273153deb79d5a8b34659ef0556dd3e39703d7d
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Thu Nov 18 18:28:39 2021 +0100

    2.11.0-git-14
---
 ChangeLog.md                                               | 11 ++++++++++-
 jspwiki-api/src/main/java/org/apache/wiki/api/Release.java |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 5435210..ac60dd7 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -17,7 +17,16 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-**2021-11-15  Juan Pablo Santos (juanpablo AT apache DOT org)**
+**2021-11-18  Juan Pablo Santos (juanpablo AT apache DOT org)**
+
+* _2.11.0-git-14_
+
+* [JSPWIKI-1160](https://issues.apache.org/jira/browse/JSPWIKI-1160) - Ensure JSPWiki builds with JDKs 8, 11 and 17
+  
+* Dependency updates
+    * Lucene to 8.11.0
+
+**2021-11-17  Juan Pablo Santos (juanpablo AT apache DOT org)**
 
 * _2.11.0-git-13_
 
diff --git a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
index 194ab3d..df97e42 100644
--- a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
+++ b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
@@ -69,7 +69,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "13";
+    public static final String     BUILD         = "14";
 
     /**
      *  This is the generic version string you should use when printing out the version.  It is of

[jspwiki] 03/04: Update Lucene to 8.11.0

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 724990a1735a6ba0103a94c6f53fdd64584e08c5
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Thu Nov 18 18:28:13 2021 +0100

    Update Lucene to 8.11.0
---
 LICENSE | 16 ++++++++--------
 pom.xml |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/LICENSE b/LICENSE
index 5ed8c61..bda75d6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -254,14 +254,14 @@ log4j-1.2-api-2.14.1.jar                    LICENSE
 log4j-api-2.14.1.jar                        LICENSE
 log4j-core-2.14.1.jar                       LICENSE
 log4j-slf4j-impl-2.14.1                     LICENSE
-lucene-analyzers-common-8.10.1.jar          LICENSE
-lucene-backward-codecs-8.10.1.jar           LICENSE
-lucene-core-8.10.1.jar                      LICENSE
-lucene-highlighter-8.10.1.jar               LICENSE
-lucene-memory-8.10.1.jar                    LICENSE
-lucene-queries-8.10.1.jar                   LICENSE
-lucene-queryparser-8.10.1.jar               LICENSE
-lucene-sandbox-8.10.1.jar                   LICENSE
+lucene-analyzers-common-8.11.0.jar          LICENSE
+lucene-backward-codecs-8.11.0.jar           LICENSE
+lucene-core-8.11.0.jar                      LICENSE
+lucene-highlighter-8.11.0.jar               LICENSE
+lucene-memory-8.11.0.jar                    LICENSE
+lucene-queries-8.11.0.jar                   LICENSE
+lucene-queryparser-8.11.0.jar               LICENSE
+lucene-sandbox-8.11.0.jar                   LICENSE
 mail-1.4.7.jar                              ./jspwiki-war/src/main/config/doc/LICENSE.cddl
 nekohtml-1.9.22.jar                         LICENSE
 org.suigeneris.jrcs.diff-0.4.2              LICENSE
diff --git a/pom.xml b/pom.xml
index 7e6f7d9..069dc69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
     <junit.version>5.8.1</junit.version>
     <log4j.version>1.2.17</log4j.version>
     <log4j2.version>2.14.1</log4j2.version>
-    <lucene.version>8.10.1</lucene.version>
+    <lucene.version>8.11.0</lucene.version>
     <mockito.version>4.0.0</mockito.version>
     <nekohtml.version>1.9.22</nekohtml.version>
     <oro.version>2.0.8</oro.version>

[jspwiki] 02/04: SQ issue - rework test so it contains an assertion

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit f2b9fe04c329ca83c38de8927e2212e291a4eae4
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Thu Nov 18 18:27:43 2021 +0100

    SQ issue - rework test so it contains an assertion
---
 .../java/org/apache/wiki/util/CryptoUtilTest.java  | 61 ++++++++--------------
 1 file changed, 22 insertions(+), 39 deletions(-)

diff --git a/jspwiki-util/src/test/java/org/apache/wiki/util/CryptoUtilTest.java b/jspwiki-util/src/test/java/org/apache/wiki/util/CryptoUtilTest.java
index 06b43ec..7aea5eb 100644
--- a/jspwiki-util/src/test/java/org/apache/wiki/util/CryptoUtilTest.java
+++ b/jspwiki-util/src/test/java/org/apache/wiki/util/CryptoUtilTest.java
@@ -18,29 +18,27 @@
  */
 package org.apache.wiki.util;
 
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
 
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-public class CryptoUtilTest
-{
+public class CryptoUtilTest {
 
     @Test
-    public void testCommandLineHash() throws Exception
-    {
+    public void testCommandLineHash() throws Exception {
         // Save old printstream
         final PrintStream oldOut = System.out;
 
         // Swallow System out and get command output
         final OutputStream out = new ByteArrayOutputStream();
         System.setOut( new PrintStream( out ) );
-        CryptoUtil.main( new String[] { "--hash", "password" } );
-        final String output = new String( out.toString() );
+        CryptoUtil.main( new String[]{ "--hash", "password" } );
+        final String output = out.toString();
 
         // Restore old printstream
         System.setOut( oldOut );
@@ -50,8 +48,7 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testCommandLineNoVerify() throws Exception
-    {
+    public void testCommandLineNoVerify() throws Exception {
         // Save old printstream
         final PrintStream oldOut = System.out;
 
@@ -59,8 +56,8 @@ public class CryptoUtilTest
         final OutputStream out = new ByteArrayOutputStream();
         System.setOut( new PrintStream( out ) );
         // Supply a bogus password
-        CryptoUtil.main( new String[] { "--verify", "password", "{SSHA}yfT8SRT/WoOuNuA6KbJeF10OznZmb28=" } );
-        final String output = new String( out.toString() );
+        CryptoUtil.main( new String[]{ "--verify", "password", "{SSHA}yfT8SRT/WoOuNuA6KbJeF10OznZmb28=" } );
+        final String output = out.toString();
 
         // Restore old printstream
         System.setOut( oldOut );
@@ -70,29 +67,21 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testCommandLineSyntaxError1() throws Exception
-    {
+    public void testCommandLineSyntaxError1() {
         // Try verifying password without the {SSHA} prefix
-        try {
-            CryptoUtil.main( new String[] { "--verify", "password", "yfT8SRT/WoOuNuA6KbJeF10OznZmb28=", "{SSHA}" } );
-        }
-        catch (final IllegalArgumentException e)
-        {
-            // Excellent; we expected an error
-        }
+        Assertions.assertThrows( IllegalArgumentException.class, () -> CryptoUtil.main( new String[]{ "--verify", "password", "yfT8SRT/WoOuNuA6KbJeF10OznZmb28=", "{SSHA}" } ) );
     }
 
     @Test
-    public void testCommandLineVerify() throws Exception
-    {
+    public void testCommandLineVerify() throws Exception {
         // Save old printstream
         final PrintStream oldOut = System.out;
 
         // Swallow System out and get command output
         final OutputStream out = new ByteArrayOutputStream();
         System.setOut( new PrintStream( out ) );
-        CryptoUtil.main( new String[] { "--verify", "testing123", "{SSHA}yfT8SRT/WoOuNuA6KbJeF10OznZmb28=" } );
-        final String output = new String( out.toString() );
+        CryptoUtil.main( new String[]{ "--verify", "testing123", "{SSHA}yfT8SRT/WoOuNuA6KbJeF10OznZmb28=" } );
+        final String output = out.toString();
 
         // Restore old printstream
         System.setOut( oldOut );
@@ -102,8 +91,7 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testExtractHash()
-    {
+    public void testExtractHash() {
         byte[] digest;
 
         digest = Base64.getDecoder().decode( "yfT8SRT/WoOuNuA6KbJeF10OznZmb28=".getBytes() );
@@ -117,8 +105,7 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testGetSaltedPassword() throws Exception
-    {
+    public void testGetSaltedPassword() throws Exception {
         byte[] password;
 
         // Generate a hash with a known password and salt
@@ -132,8 +119,7 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testMultipleHashes() throws Exception
-    {
+    public void testMultipleHashes() throws Exception {
         final String p1 = CryptoUtil.getSaltedPassword( "password".getBytes(), "{SSHA}" );
         final String p2 = CryptoUtil.getSaltedPassword( "password".getBytes(), "{SSHA}" );
         final String p3 = CryptoUtil.getSaltedPassword( "password".getBytes(), "{SSHA}" );
@@ -143,8 +129,7 @@ public class CryptoUtilTest
     }
 
     @Test
-    public void testSaltedPasswordLength() throws Exception
-    {
+    public void testSaltedPasswordLength() throws Exception {
         // Generate a hash with a known password and salt
         final byte[] password = "mySooperRandomPassword".getBytes();
         final String hash = CryptoUtil.getSaltedPassword( password, "salt".getBytes(), "{SSHA}" );
@@ -154,12 +139,10 @@ public class CryptoUtilTest
         Assertions.assertEquals( 38, hash.length() );
     }
 
-    public void verifySaltedPassword() throws Exception
-    {
-        byte[] password;
-
+    @Test
+    public void verifySaltedPassword() throws Exception {
         // Verify with a known digest
-        password = "testing123".getBytes(StandardCharsets.UTF_8.name());
+        byte[] password = "testing123".getBytes( StandardCharsets.UTF_8.name() );
         Assertions.assertTrue( CryptoUtil.verifySaltedPassword( password, "{SSHA}yfT8SRT/WoOuNuA6KbJeF10OznZmb28=" ) );
 
         // Verify with two more known digests