Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SHIRO-895] Workaround Guice Java17 compat and run tests on 17. #507

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/checkout@v3.1.0

- name: Set up cache for ~./m2/repository
uses: actions/cache@v3.0.10
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>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<htmlunit.version>2.65.1</htmlunit.version>

<!-- Test 3rd-party dependencies: -->
<easymock.version>4.3</easymock.version>
<easymock.version>5.0.1</easymock.version>
<gmaven.version>1.13.1</gmaven.version>
<groovy.version>2.5.18</groovy.version>
<junit.version>4.13.2</junit.version>
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>
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