Skip to content

Commit

Permalink
set jdk for maven-surefire-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed May 23, 2024
1 parent af2965e commit d722080
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions gax-java/gax/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,49 @@
</excludes>
</configuration>
</plugin>
<plugin>
<!-- Troubleshooting a flaky test in https://github.com/googleapis/sdk-platform-java/issues/1931 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-Djava.util.logging.SimpleFormatter.format="%1$tY %1$tl:%1$tM:%1$tS.%1$tL %2$s %4$s: %5$s%6$s%n"
<!-- workaround setup for using junit-pioneer with Java 17 or above,
see https://junit-pioneer.org/docs/environment-variables/#warnings-for-reflective-access -->
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>

<profiles>
<profile>
<id>java17-unit-test</id>
<activation>
<jdk>[17,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-Djava.util.logging.SimpleFormatter.format="%1$tY %1$tl:%1$tM:%1$tS.%1$tL %2$s %4$s: %5$s%6$s%n"
<!-- workaround setup for using junit-pioneer with Java 17 or above,
see https://junit-pioneer.org/docs/environment-variables/#warnings-for-reflective-access -->
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine></configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java16-unit-test</id>
<activation>
<jdk>(,16]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-Djava.util.logging.SimpleFormatter.format="%1$tY %1$tl:%1$tM:%1$tS.%1$tL %2$s %4$s: %5$s%6$s%n"
</argLine></configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit d722080

Please sign in to comment.