Skip to content

Commit

Permalink
Merge pull request #507 from apache/SHIRO-895_guice_java17_build
Browse files Browse the repository at this point in the history
[SHIRO-895] Workaround Guice Java17 compat and run tests on 17.
  • Loading branch information
bmarwell authored Oct 26, 2022
2 parents c656056 + f5f1098 commit 396c88f
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 17 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
- version: 11
dist: zulu
# 14
- version: 14
- version: 17
dist: adopt-hotspot
- version: 14
- version: 17
dist: adopt-openj9
- version: 14
- version: 17
dist: zulu
exclude:
# was already built
Expand All @@ -82,7 +82,7 @@ jobs:
# excludes java 16 on macOS.
- os: macOS-latest
java:
version: 16
version: 11
# exclude adopt-hotspot on MacOS. zulu (also hotspot) and OpenJ9 are sufficient.
- os: macOS-latest
java:
Expand All @@ -95,17 +95,6 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- name: Set up cache for ~./m2/repository
uses: actions/[email protected]
with:
path: |
~/.m2/repository
!~/.m2/repository/org/apache/shiro
key: maven-${{ matrix.os }}-java${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ matrix.os }}-java${{ matrix.java }}-
maven-${{ matrix.os }}-
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand Down
25 changes: 25 additions & 0 deletions integration-tests/guice3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,29 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>jdk16</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<properties>
<!-- needed by guice until it is compatible with jdk16+. -->
<surefire.argLine>--illegal-access=permit</surefire.argLine>
<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>
25 changes: 25 additions & 0 deletions integration-tests/guice4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,29 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>jdk16</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<properties>
<!-- needed by guice until it is compatible with jdk16+. -->
<surefire.argLine>--illegal-access=permit</surefire.argLine>
<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>
25 changes: 25 additions & 0 deletions samples/guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,29 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>jdk16</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<properties>
<!-- needed by guice until it is compatible with jdk16+. -->
<surefire.argLine>--illegal-access=permit</surefire.argLine>
<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>
23 changes: 23 additions & 0 deletions support/guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,27 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk16</id>
<activation>
<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>
4 changes: 2 additions & 2 deletions support/hazelcast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
<jdk>[8,)</jdk>
</activation>
<properties>
<surefire.argLine> --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED</surefire.argLine>
<failsafe.argLine> --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED</failsafe.argLine>
<surefire.argLine> --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.ref=ALL-UNNAMED</surefire.argLine>
<failsafe.argLine> --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.ref=ALL-UNNAMED</failsafe.argLine>
</properties>
</profile>
</profiles>
Expand Down

0 comments on commit 396c88f

Please sign in to comment.