Skip to content

Commit b220408

Browse files
authored
Add --add-opens to surefire for running tests on Java SE 17+ (#565)
* Add --add-opens to surefire for running tests on Java SE 17+ * Only set the opens command line for Java SE 11+ Fixes #564
1 parent 5c30bf9 commit b220408

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

testenrichers/cdi/pom.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<version.javax-el>2.2</version.javax-el>
2828
<version.slf4j>2.0.12</version.slf4j>
2929

30+
<java11.opensargs></java11.opensargs>
3031
</properties>
3132

3233
<!-- Dependencies -->
@@ -119,5 +120,30 @@
119120
<scope>test</scope>
120121
</dependency>
121122
</dependencies>
122-
</project>
123123

124+
<build>
125+
<plugins>
126+
<plugin>
127+
<groupId>org.apache.maven.plugins</groupId>
128+
<artifactId>maven-surefire-plugin</artifactId>
129+
<configuration>
130+
<argLine>
131+
${java11.opensargs}
132+
</argLine>
133+
</configuration>
134+
</plugin>
135+
</plugins>
136+
</build>
137+
138+
<profiles>
139+
<profile>
140+
<id>not-java8</id>
141+
<activation>
142+
<jdk>[11,]</jdk>
143+
</activation>
144+
<properties>
145+
<java11.opensargs>--add-opens java.base/java.lang=ALL-UNNAMED</java11.opensargs>
146+
</properties>
147+
</profile>
148+
</profiles>
149+
</project>

0 commit comments

Comments
 (0)