diff --git a/.github/workflows/build-feature.yml b/.github/workflows/build-feature.yml index c06ce3affb6..dee33514dae 100644 --- a/.github/workflows/build-feature.yml +++ b/.github/workflows/build-feature.yml @@ -24,18 +24,7 @@ jobs: with: distribution: 'adopt' java-version: '17' - - - name: Cache local Maven repository - uses: actions/cache@v3.3.1 - env: - cache-name: cache-mvn - with: - path: ~/.m2/repository - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: 'maven' - name: Cache node modules uses: actions/cache@v3 @@ -51,7 +40,6 @@ jobs: # otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error - name: Build with Maven run: | - mvn -B spring-javaformat:apply --no-transfer-progress mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 1e6934cb6ce..bee51bd2d5c 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -23,18 +23,7 @@ jobs: with: distribution: 'adopt' java-version: '17' - - - name: Cache local Maven repository - uses: actions/cache@v3.3.1 - env: - cache-name: cache-mvn - with: - path: ~/.m2/repository - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: 'maven' - name: Cache node modules uses: actions/cache@v3 @@ -50,7 +39,6 @@ jobs: # otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error - name: Build with Maven run: | - mvn -B spring-javaformat:apply --no-transfer-progress mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true - uses: codecov/codecov-action@v3 @@ -69,18 +57,7 @@ jobs: with: distribution: 'adopt' java-version: '17' - - - name: Cache local Maven repository - uses: actions/cache@v3.3.1 - env: - cache-name: cache-mvn - with: - path: ~/.m2/repository - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: 'maven' - name: Cache node modules uses: actions/cache@v3 diff --git a/.github/workflows/build-pullrequest.yml b/.github/workflows/build-pullrequest.yml index 68e85a5402d..9d1a101c13f 100644 --- a/.github/workflows/build-pullrequest.yml +++ b/.github/workflows/build-pullrequest.yml @@ -19,18 +19,7 @@ jobs: with: distribution: 'adopt' java-version: '17' - - - name: Cache local Maven repository - uses: actions/cache@v3.3.1 - env: - cache-name: cache-mvn - with: - path: ~/.m2/repository - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: 'maven' - name: Cache node modules uses: actions/cache@v3 @@ -46,7 +35,6 @@ jobs: # otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error - name: Build with Maven run: | - mvn -B spring-javaformat:apply --no-transfer-progress mvn -B verify -P coverage --no-transfer-progress -D maven.javadoc.skip=true - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml index a47a9ed7168..ea3cdb808fb 100644 --- a/.github/workflows/release-to-maven-central.yml +++ b/.github/workflows/release-to-maven-central.yml @@ -31,18 +31,7 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Cache local Maven repository - uses: actions/cache@v3.3.1 - env: - cache-name: cache-mvn - with: - path: ~/.m2/repository - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache: 'maven' - name: Cache node modules uses: actions/cache@v3 @@ -58,7 +47,7 @@ jobs: run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress - name: Publish package - run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true + run: mvn -B deploy --no-transfer-progress -P central-deploy -DskipTests=true env: #TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16 JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED" diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java index 4398e16127a..11a3cf3d59a 100644 --- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java @@ -44,8 +44,8 @@ public class SpringBootAdminClientAutoConfigurationTest { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, - DispatcherServletAutoConfiguration.class, RestTemplateAutoConfiguration.class, - SpringBootAdminClientAutoConfiguration.class)); + DispatcherServletAutoConfiguration.class, RestTemplateAutoConfiguration.class, + SpringBootAdminClientAutoConfiguration.class)); @Test public void not_active() { @@ -62,7 +62,7 @@ public void active() { public void disabled() { this.contextRunner .withPropertyValues("spring.boot.admin.client.url:http://localhost:8081", - "spring.boot.admin.client.enabled:false") + "spring.boot.admin.client.enabled:false") .run((context) -> assertThat(context).doesNotHaveBean(ApplicationRegistrator.class)); } @@ -79,8 +79,8 @@ public void nonWebEnvironment() { public void reactiveEnvironment() { ReactiveWebApplicationContextRunner reactiveContextRunner = new ReactiveWebApplicationContextRunner() .withConfiguration( - AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, - WebClientAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)) + AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, + WebClientAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)) .withBean(WebFluxProperties.class); reactiveContextRunner.withPropertyValues("spring.boot.admin.client.url:http://localhost:8081") .run((context) -> assertThat(context).hasSingleBean(ApplicationRegistrator.class)); @@ -90,16 +90,16 @@ public void reactiveEnvironment() { public void blockingClientInBlockingEnvironment() { WebApplicationContextRunner webApplicationContextRunner = new WebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(EndpointAutoConfiguration.class, - WebEndpointAutoConfiguration.class, DispatcherServletAutoConfiguration.class, - RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)); + WebEndpointAutoConfiguration.class, DispatcherServletAutoConfiguration.class, + RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)); webApplicationContextRunner .withPropertyValues("spring.boot.admin.client.url:http://localhost:8081", - "spring.boot.admin.client.connectTimeout=1337", "spring.boot.admin.client.readTimeout=42") + "spring.boot.admin.client.connectTimeout=1337", "spring.boot.admin.client.readTimeout=42") .run((context) -> { RegistrationClient registrationClient = context.getBean(RegistrationClient.class); RestTemplate restTemplate = (RestTemplate) ReflectionTestUtils.getField(registrationClient, - "restTemplate"); + "restTemplate"); assertThat(restTemplate).isNotNull(); ClientHttpRequestFactory requestFactory = restTemplate.getRequestFactory(); @@ -116,8 +116,8 @@ public void customBlockingClientInReactiveEnvironment() { ReactiveWebApplicationContextRunner reactiveContextRunner = new ReactiveWebApplicationContextRunner() .withConfiguration(UserConfigurations.of(CustomBlockingConfiguration.class)) .withConfiguration( - AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, - WebClientAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)) + AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, + WebClientAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)) .withBean(WebFluxProperties.class); reactiveContextRunner.withPropertyValues("spring.boot.admin.client.url:http://localhost:8081") @@ -133,8 +133,8 @@ public void customBlockingClientInBlockingEnvironment() { WebApplicationContextRunner webApplicationContextRunner = new WebApplicationContextRunner() .withConfiguration(UserConfigurations.of(CustomBlockingConfiguration.class)) .withConfiguration(AutoConfigurations.of(EndpointAutoConfiguration.class, - WebEndpointAutoConfiguration.class, DispatcherServletAutoConfiguration.class, - RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)); + WebEndpointAutoConfiguration.class, DispatcherServletAutoConfiguration.class, + RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class)); webApplicationContextRunner.withPropertyValues("spring.boot.admin.client.url:http://localhost:8081") .run((context) -> { diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java index da18cda8981..40f59a07e93 100644 --- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java +++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java @@ -36,9 +36,9 @@ public class SpringBootAdminClientCloudFoundryAutoConfigurationTest { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withConfiguration(AutoConfigurations.of(EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, - WebMvcAutoConfiguration.class, DispatcherServletAutoConfiguration.class, - RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class, - SpringBootAdminClientCloudFoundryAutoConfiguration.class)); + WebMvcAutoConfiguration.class, DispatcherServletAutoConfiguration.class, + RestTemplateAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class, + SpringBootAdminClientCloudFoundryAutoConfiguration.class)); @Test public void non_cloud_platform() {