Merge pull request #328 from bmarwell/java17_jenkins

[SHIRO-840] Use Java17 buildjob on Jenkins
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 40bebb8..63c0955 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -33,7 +33,7 @@
         uses: actions/checkout@v2
 
       - name: Set up JDK
-        uses: actions/setup-java@v2.1.0
+        uses: actions/setup-java@v2
         with:
           java-version: 8
           distribution: adopt-hotspot
@@ -42,7 +42,7 @@
         run: mvn apache-rat:check "-Drat.consoleOutput"
 
       - name: Build with Maven
-        run: mvn verify --errors --batch-mode --no-transfer-progress -Pdocs
+        run: mvn verify --show-version --errors --batch-mode --no-transfer-progress -Pdocs
 
   build-all:
     needs: build
@@ -65,12 +65,12 @@
             dist: adopt-openj9
           - version: 11
             dist: zulu
-          # 16
-          - version: 16
-            dist: adopt-hotspot
+          # 17 (16 fallback)
+          - version: 17
+            dist: temurin
           - version: 16
             dist: adopt-openj9
-          - version: 16
+          - version: 17
             dist: zulu
         exclude:
           # was already built
@@ -83,7 +83,7 @@
           - os: macOS-latest
             java:
               version: 16
-          # exclude adopt-hotspot on MacOS. zulu (also hotspot) and OpenJ9 are sufficient.
+          # exclude temurin on MacOS. zulu (also hotspot) and OpenJ9 are sufficient.
           - os: macOS-latest
             java:
               dist: adopt-hotspot
@@ -107,10 +107,10 @@
             maven-${{ matrix.os }}-
 
       - name: Set up JDK
-        uses: actions/setup-java@v2.1.0
+        uses: actions/setup-java@v2
         with:
           java-version: ${{ matrix.java.version }}
           distribution: ${{ matrix.java.dist }}
 
       - name: Build with Maven
-        run: mvn verify --errors --batch-mode --no-transfer-progress -Pdocs
+        run: mvn verify --show-version --errors --batch-mode --no-transfer-progress -Pdocs
diff --git a/.jenkins.groovy b/.jenkins.groovy
index 7025fd3..5d71849 100644
--- a/.jenkins.groovy
+++ b/.jenkins.groovy
@@ -93,7 +93,7 @@
                     stage('Build') {
                         steps {
                             echo 'Building'
-                            sh 'mvn --update-snapshots --batch-mode --errors clean verify -Pdocs -Dmaven.test.failure.ignore=true'
+                            sh 'mvn clean verify --show-version --errors --batch-mode --no-transfer-progress -Pdocs -Dmaven.test.failure.ignore=true'
                         }
                         post {
                             always {
diff --git a/integration-tests/guice3/pom.xml b/integration-tests/guice3/pom.xml
index e335cbb..29d62a6 100644
--- a/integration-tests/guice3/pom.xml
+++ b/integration-tests/guice3/pom.xml
@@ -135,5 +135,16 @@
 				<failsafe.argLine>--illegal-access=permit</failsafe.argLine>
 			</properties>
 		</profile>
+		<profile>
+			<id>jdk17</id>
+			<activation>
+				<jdk>[17,)</jdk>
+			</activation>
+			<properties>
+				<!-- needed by guice until it is compatible with jdk17+. -->
+				<surefire.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</surefire.argLine>
+				<failsafe.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</failsafe.argLine>
+			</properties>
+		</profile>
 	</profiles>
 </project>
diff --git a/integration-tests/guice4/pom.xml b/integration-tests/guice4/pom.xml
index 0e5af10..4d4c3b0 100644
--- a/integration-tests/guice4/pom.xml
+++ b/integration-tests/guice4/pom.xml
@@ -140,5 +140,16 @@
 				<failsafe.argLine>--illegal-access=permit</failsafe.argLine>
 			</properties>
 		</profile>
+		<profile>
+			<id>jdk17</id>
+			<activation>
+				<jdk>[17,)</jdk>
+			</activation>
+			<properties>
+				<!-- needed by guice until it is compatible with jdk17+. -->
+				<surefire.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</surefire.argLine>
+				<failsafe.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</failsafe.argLine>
+			</properties>
+		</profile>
 	</profiles>
 </project>
diff --git a/pom.xml b/pom.xml
index 2011d5a..62a1e9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,17 +109,17 @@
         <log4j.version>1.2.17</log4j.version>
         <spring.version>5.2.8.RELEASE</spring.version>
         <spring-boot.version>2.3.2.RELEASE</spring-boot.version>
-        <guice.version>4.2.2</guice.version>
+        <guice.version>4.2.3</guice.version>
         <jaxrs.api.version>2.1.6</jaxrs.api.version>
         <htmlunit.version>2.39.0</htmlunit.version>
         <bouncycastle.version>1.68</bouncycastle.version>
 
         <!-- Test 3rd-party dependencies: -->
         <easymock.version>4.0.2</easymock.version>
-        <mockito.version>3.7.0</mockito.version>
-        <gmaven.version>1.12.0</gmaven.version>
-        <groovy.version>3.0.7</groovy.version>
-        <junit.version>5.6.2</junit.version>
+        <mockito.version>3.12.4</mockito.version>
+        <gmaven.version>1.13.0</gmaven.version>
+        <groovy.version>3.0.9</groovy.version>
+        <junit.version>5.8.1</junit.version>
         <junit.server.jetty.version>0.11.0</junit.server.jetty.version>
         <hibernate.version>5.4.3.Final</hibernate.version>
         <taglibs.standard.version>1.2.5</taglibs.standard.version>
@@ -334,7 +334,7 @@
                 <plugin>
                     <groupId>org.jacoco</groupId>
                     <artifactId>jacoco-maven-plugin</artifactId>
-                    <version>0.8.6</version>
+                    <version>0.8.7</version>
                 </plugin>
                 <plugin>
                     <groupId>com.mycila</groupId>
@@ -401,14 +401,9 @@
                     <version>3.0.0-M2</version>
                 </plugin>
                 <plugin>
-                    <groupId>dev.aspectj</groupId>
-                    <artifactId>aspectj-maven-plugin</artifactId>
-                    <version>1.13.M3</version>
-                    <!-- Using a fork, until such time that the aspect-maven-plugin updates to support JDK 11 - https://github.com/mojohaus/aspectj-maven-plugin/pull/45
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>aspectj-maven-plugin</artifactId>
-                    <version>1.11</version>
-                    -->
+                    <version>1.14.0</version>
                     <configuration>
                         <source>${jdk.version}</source>
                         <target>${jdk.version}</target>
@@ -1492,6 +1487,31 @@
                     <url>scm:svn:https://svn.apache.org/repos/asf/shiro/site/publish/static/${project.version}</url>
                 </site>
             </distributionManagement>
+            <build>
+                <plugins>
+                    <!-- calculate checksums of source release for Apache dist area -->
+                    <plugin>
+                        <groupId>net.nicoulaj.maven.plugins</groupId>
+                        <artifactId>checksum-maven-plugin</artifactId>
+                        <version>1.11</version>
+                        <executions>
+                            <execution>
+                                <id>source-release-checksum</id>
+                                <goals>
+                                    <goal>artifacts</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <algorithms>
+                                <algorithm>SHA-512</algorithm>
+                                <algorithm>SHA3-512</algorithm>
+                            </algorithms>
+                            <csvSummary>false</csvSummary>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
         </profile>
         <profile>
             <!--  NOTE: this plugin config will return false positives, usage will require
diff --git a/samples/aspectj/pom.xml b/samples/aspectj/pom.xml
index f3a5cfb..5fc808c 100644
--- a/samples/aspectj/pom.xml
+++ b/samples/aspectj/pom.xml
@@ -34,12 +34,8 @@
 	<build>
 		<plugins>
 			<plugin>
-				<groupId>dev.aspectj</groupId>
-				<artifactId>aspectj-maven-plugin</artifactId>
-				<!-- Using a fork, until such time that the aspect-maven-plugin updates to support JDK 11 - https://github.com/mojohaus/aspectj-maven-plugin/pull/45
 				<groupId>org.codehaus.mojo</groupId>
 				<artifactId>aspectj-maven-plugin</artifactId>
-				-->
 				<configuration>
 					<aspectLibraries>
 						<aspectLibrary>
diff --git a/samples/guice/pom.xml b/samples/guice/pom.xml
index f1bcaeb..50afb36 100644
--- a/samples/guice/pom.xml
+++ b/samples/guice/pom.xml
@@ -125,5 +125,16 @@
 				<failsafe.argLine>--illegal-access=permit</failsafe.argLine>
 			</properties>
 		</profile>
+		<profile>
+			<id>jdk17</id>
+			<activation>
+				<jdk>[17,)</jdk>
+			</activation>
+			<properties>
+				<!-- needed by guice until it is compatible with jdk17+. -->
+				<surefire.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</surefire.argLine>
+				<failsafe.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</failsafe.argLine>
+			</properties>
+		</profile>
 	</profiles>
 </project>
diff --git a/samples/spring-mvc/src/main/resources/jsecurity-sample.jks b/samples/spring-mvc/src/main/resources/jsecurity-sample.jks
deleted file mode 100644
index eb2ff9b..0000000
--- a/samples/spring-mvc/src/main/resources/jsecurity-sample.jks
+++ /dev/null
Binary files differ
diff --git a/support/aspectj/pom.xml b/support/aspectj/pom.xml
index 46190c4..10cb953 100644
--- a/support/aspectj/pom.xml
+++ b/support/aspectj/pom.xml
@@ -62,12 +62,24 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>dev.aspectj</groupId>
-                <artifactId>aspectj-maven-plugin</artifactId>
-                <!-- Using a fork, until such time that the aspect-maven-plugin updates to support JDK 11 - https://github.com/mojohaus/aspectj-maven-plugin/pull/45
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>aspectj-maven-plugin</artifactId>
-                -->
+                <executions>
+                    <execution>
+                        <id>aspectj-compile</id>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.aspectj</groupId>
+                        <artifactId>aspectjtools</artifactId>
+                        <version>${aspectj.version}</version>
+                    </dependency>
+                </dependencies>
             </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
diff --git a/support/guice/pom.xml b/support/guice/pom.xml
index 26d332c..7c76e2b 100644
--- a/support/guice/pom.xml
+++ b/support/guice/pom.xml
@@ -128,12 +128,22 @@
         <profile>
             <id>jdk16</id>
             <activation>
-                <jdk>[16,)</jdk>
+                <jdk>[16,17)</jdk>
             </activation>
             <properties>
                 <!-- needed by guice until it is compatible with jdk16+. -->
                 <surefire.argLine>--illegal-access=permit</surefire.argLine>
             </properties>
         </profile>
+        <profile>
+            <id>jdk17</id>
+            <activation>
+                <jdk>[17,)</jdk>
+            </activation>
+            <properties>
+                <!-- needed by guice until it is compatible with jdk17+. -->
+                <surefire.argLine>--add-opens java.base/java.lang=ALL-UNNAMED</surefire.argLine>
+            </properties>
+        </profile>
     </profiles>
 </project>