Skip to content

Commit

Permalink
[SHIRO-895] Workaround Guice Java17 compat and run tests on 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell committed Oct 25, 2022
1 parent 5e5bcb1 commit ca39255
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 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 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>

0 comments on commit ca39255

Please sign in to comment.