maven-compiler-plugin maintenance (#1731)

* Override inheritance of HAPI's old maven-compiler-plugin

and stop using deprecated forceJavacCompilerUse

* Take checkstyle plugin out of default build

* Use less for initial JVM opts (maybe forked compilers will need this)

* Try on a mac?

* Report free space, add MAVEN_OPTS

* No MAVEN_OPTS?

* Back to ubuntu

* Try some compiler args and max mem

* Try some MaxRamPercentage on surefire too

* Try 75.0 MaxRamPercentage

* 60?

* Update surefire version, even less Xmx

* Revert I18nBase style fix (get tests to pass, apply later)

* Now that memory is less of an issue, try checkstyle again

* Fix missing single quote

* Try 50% of 7G for Xmx
This commit is contained in:
dotasek 2024-10-07 11:01:08 -04:00 committed by GitHub
parent 4b374cb57b
commit 093fbbc0f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 61 additions and 30 deletions

View File

@ -15,7 +15,7 @@ public class TestConfig {
@Getter @Setter
private boolean rebuildCache = System.getProperty(FHIR_TXCACHE_REBUILD) != null && "TRUE".equalsIgnoreCase(System.getProperty(FHIR_TXCACHE_REBUILD));
@Getter @Setter
@Setter
private String txCacheDirectory = TestConstants.TX_CACHE;
@Getter @Setter

76
pom.xml
View File

@ -25,7 +25,7 @@
<jackson_version>2.17.0</jackson_version>
<junit_jupiter_version>5.9.2</junit_jupiter_version>
<junit_platform_launcher_version>1.8.2</junit_platform_launcher_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>
<maven_surefire_version>3.1.2</maven_surefire_version>
<maven_clean_version>3.1.0</maven_clean_version>
<okhttp.version>4.11.0</okhttp.version>
<jacoco_version>0.8.12</jacoco_version>
@ -361,7 +361,7 @@
<!-- We need to include the ${argLine} here so the Jacoco test arguments are included in the
Surefire testing run. This may appear as an error in some IDEs, but it will run regardless.
-->
<argLine>@{argLine} -Xmx5632m</argLine>
<argLine>@{argLine} -Xmx3500m -XX:MaxRAMPercentage=50.0</argLine>
<systemPropertyVariables>
<java.locale.providers>COMPAT</java.locale.providers>
<!-- For JUnit4 use TestUtilities.runningAsSurefire() or
@ -385,6 +385,18 @@
<formats>sarif,html</formats>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
<plugins>
@ -395,41 +407,25 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>checkstyle</goal>
</goals>
<configuration>
<failsOnError>true</failsOnError>
<suppressionsLocation>${project.basedir}/checkstyle_suppressions.xml</suppressionsLocation>
<enableRulesSummary>true</enableRulesSummary>
<enableSeveritySummary>true</enableSeveritySummary>
<consoleOutput>true</consoleOutput>
<configLocation>${checkstyle_config_location}/checkstyle.xml</configLocation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>11</release>
<forceJavacCompilerUse>false</forceJavacCompilerUse>
<forceLegacyJavacApi>false</forceLegacyJavacApi>
<encoding>UTF-8</encoding>
<!-- Allows running the compiler in a separate process. If false it uses the built in compiler,
<!-- Allows running the compiler in a separate process. If false it uses the built-in compiler,
while if true it will use an executable. -->
<fork>true</fork>
<meminitial>512m</meminitial>
<maxmem>5632m</maxmem>
<maxmem>768m</maxmem>
<debug>true</debug>
<compilerArgs>
<arg>-J-XX:MaxRAMPercentage=50.0</arg>
</compilerArgs>
</configuration>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
@ -840,6 +836,36 @@
</plugins>
</build>
</profile>
<profile>
<id>CHECKSTYLE</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>checkstyle</goal>
</goals>
<configuration>
<failsOnError>true</failsOnError>
<suppressionsLocation>${project.basedir}/checkstyle_suppressions.xml</suppressionsLocation>
<enableRulesSummary>true</enableRulesSummary>
<enableSeveritySummary>true</enableSeveritySummary>
<consoleOutput>true</consoleOutput>
<configLocation>${checkstyle_config_location}/checkstyle.xml</configLocation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>

View File

@ -25,12 +25,17 @@ jobs:
inputs:
mavenPomFile: 'pom.xml'
${{ if eq(parameters.signArtifacts, true) }}:
options: '--settings $(Agent.TempDirectory)/settings.xml -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests -DdeployToSonatype'
options: '--settings $(Agent.TempDirectory)/settings.xml -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests -DdeployToSonatype -P CHECKSTYLE'
${{ else }}:
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests'
mavenOptions: '-Xmx3072m'
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests -P CHECKSTYLE'
mavenOptions: '-Xmx768m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'
goals: 'install'
- task: Bash@3
displayName: Report free disk space
inputs:
targetType: 'inline'
script: df -H .