Skip to content

Commit 51a9a6f

Browse files
authored
fix: make java.base fields accessible to fix java 17 runtime errors. (googleapis#688)
* fix: java 17 reflection issue * add java.security
1 parent f8422eb commit 51a9a6f

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • java-os-login/google-cloud-os-login

java-os-login/google-cloud-os-login/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
</dependency>
9797
</dependencies>
9898

99+
99100
<profiles>
100101
<profile>
101102
<id>java9</id>
@@ -109,6 +110,30 @@
109110
</dependency>
110111
</dependencies>
111112
</profile>
113+
<profile>
114+
<id>java17</id>
115+
<activation>
116+
<jdk>[17,)</jdk>
117+
</activation>
118+
<build>
119+
<plugins>
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-surefire-plugin</artifactId>
123+
<configuration>
124+
<argLine>--add-opens=java.base/java.time=ALL-UNNAMED
125+
--add-opens=java.base/java.math=ALL-UNNAMED
126+
--add-opens=java.base/sun.security.rsa=ALL-UNNAMED
127+
--add-opens=java.base/sun.security.pkcs=ALL-UNNAMED
128+
--add-opens=java.base/sun.security.x509=ALL-UNNAMED
129+
--add-opens=java.base/sun.security.util=ALL-UNNAMED
130+
--add-opens=java.base/java.security=ALL-UNNAMED</argLine>
131+
</configuration>
132+
</plugin>
133+
</plugins>
134+
</build>
135+
136+
</profile>
112137
</profiles>
113138

114139
<build>

0 commit comments

Comments
 (0)