diff --git a/components/recipe-test-support/src/main/java/org/springframework/sbm/test/RecipeIntegrationTestSupport.java b/components/recipe-test-support/src/main/java/org/springframework/sbm/test/RecipeIntegrationTestSupport.java index e9e8ff49d..fdc18a4ea 100644 --- a/components/recipe-test-support/src/main/java/org/springframework/sbm/test/RecipeIntegrationTestSupport.java +++ b/components/recipe-test-support/src/main/java/org/springframework/sbm/test/RecipeIntegrationTestSupport.java @@ -133,12 +133,11 @@ public void andApplyRecipeComparingWithExpected(String recipeName) { try (Stream walk = Files.walk(expectedProject)) { result = walk.filter(Files::isRegularFile) .map(f -> expectedProject.relativize(f)) - .filter(f -> f.toString().startsWith("target/")) .collect(Collectors.toList()); } result.stream() - .forEach(r -> assertThat(r).hasSameTextualContentAs(migratedProject.resolve(r))); + .forEach(r -> assertThat(expectedProject.resolve(r)).hasSameTextualContentAs(migratedProject.resolve(r))); } catch (Exception exception) { throw new RuntimeException(exception); } diff --git a/components/sbm-support-boot/src/main/java/org/springframework/sbm/boot/properties/actions/AddSpringBootApplicationPropertiesAction.java b/components/sbm-support-boot/src/main/java/org/springframework/sbm/boot/properties/actions/AddSpringBootApplicationPropertiesAction.java index b6dea3e60..d2be10695 100644 --- a/components/sbm-support-boot/src/main/java/org/springframework/sbm/boot/properties/actions/AddSpringBootApplicationPropertiesAction.java +++ b/components/sbm-support-boot/src/main/java/org/springframework/sbm/boot/properties/actions/AddSpringBootApplicationPropertiesAction.java @@ -16,7 +16,11 @@ package org.springframework.sbm.boot.properties.actions; import lombok.AllArgsConstructor; +import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.SuperBuilder; + import org.springframework.sbm.boot.properties.api.SpringBootApplicationProperties; import org.springframework.sbm.boot.properties.search.SpringBootApplicationPropertiesResourceListFilter; import org.springframework.sbm.build.api.Module; @@ -27,6 +31,9 @@ @NoArgsConstructor @AllArgsConstructor +@Getter +@Setter +@SuperBuilder public class AddSpringBootApplicationPropertiesAction extends AbstractAction { public static final Path APPLICATION_PROPERTIES_PATH = Path.of("src/main/resources/application.properties"); diff --git a/components/sbm-support-boot/src/main/resources/recipes/initialize-spring-boot-migration.yaml b/components/sbm-support-boot/src/main/resources/recipes/initialize-spring-boot-migration.yaml index 00c682319..39feb4eee 100644 --- a/components/sbm-support-boot/src/main/resources/recipes/initialize-spring-boot-migration.yaml +++ b/components/sbm-support-boot/src/main/resources/recipes/initialize-spring-boot-migration.yaml @@ -91,6 +91,7 @@ plugin: groupId: org.springframework.boot artifactId: spring-boot-maven-plugin + version: 2.7.3 condition: type: org.springframework.sbm.build.migration.conditions.MavenPluginDoesNotExist plugin: @@ -108,11 +109,13 @@ org.springframework.boot spring-boot-maven-plugin + 2.7.3 - type: org.springframework.sbm.boot.properties.actions.AddSpringBootApplicationPropertiesAction + addDefaultPropertiesFileToTopModules: true condition: type: org.springframework.sbm.boot.properties.conditions.NoSpringBootApplicationPropertiesExists description: Create application.properties file. diff --git a/components/sbm-support-boot/src/main/resources/templates/minimal-pom-xml.ftl b/components/sbm-support-boot/src/main/resources/templates/minimal-pom-xml.ftl index ca54ff935..7999e1aa7 100644 --- a/components/sbm-support-boot/src/main/resources/templates/minimal-pom-xml.ftl +++ b/components/sbm-support-boot/src/main/resources/templates/minimal-pom-xml.ftl @@ -7,8 +7,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} ${artifactId} ${version} diff --git a/components/sbm-support-boot/testcode/empty-project/expected/pom.xml b/components/sbm-support-boot/testcode/empty-project/expected/pom.xml index d5c248b1e..1a0e03190 100644 --- a/components/sbm-support-boot/testcode/empty-project/expected/pom.xml +++ b/components/sbm-support-boot/testcode/empty-project/expected/pom.xml @@ -1,18 +1,9 @@ org.springframework.boot spring-boot-dependencies - 2.6.3 + 2.7.3 pom import @@ -54,6 +45,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.7.3 diff --git a/components/sbm-support-boot/testcode/empty-project/expected/src/main/java/com/boot/migrator/SpringBootApp.java b/components/sbm-support-boot/testcode/empty-project/expected/src/main/java/org/springframework/sbm/SpringBootApp.java similarity index 89% rename from components/sbm-support-boot/testcode/empty-project/expected/src/main/java/com/boot/migrator/SpringBootApp.java rename to components/sbm-support-boot/testcode/empty-project/expected/src/main/java/org/springframework/sbm/SpringBootApp.java index fd6c94272..b4d64f7d8 100644 --- a/components/sbm-support-boot/testcode/empty-project/expected/src/main/java/com/boot/migrator/SpringBootApp.java +++ b/components/sbm-support-boot/testcode/empty-project/expected/src/main/java/org/springframework/sbm/SpringBootApp.java @@ -1,4 +1,4 @@ -package com.boot.migrator; +package org.springframework.sbm; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/components/sbm-support-boot/testcode/empty-project/expected/src/main/resources/application.properties b/components/sbm-support-boot/testcode/empty-project/expected/src/main/resources/application.properties index 5c81fd7d4..e69de29bb 100644 --- a/components/sbm-support-boot/testcode/empty-project/expected/src/main/resources/application.properties +++ b/components/sbm-support-boot/testcode/empty-project/expected/src/main/resources/application.properties @@ -1,16 +0,0 @@ -# -# Copyright 2021 - 2022 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - diff --git a/components/sbm-support-boot/testcode/empty-project/expected/src/test/java/com/boot/migrator/SpringBootAppTest.java b/components/sbm-support-boot/testcode/empty-project/expected/src/test/java/org/springframework/sbm/SpringBootAppTest.java similarity index 84% rename from components/sbm-support-boot/testcode/empty-project/expected/src/test/java/com/boot/migrator/SpringBootAppTest.java rename to components/sbm-support-boot/testcode/empty-project/expected/src/test/java/org/springframework/sbm/SpringBootAppTest.java index 37091d86a..896effe1c 100644 --- a/components/sbm-support-boot/testcode/empty-project/expected/src/test/java/com/boot/migrator/SpringBootAppTest.java +++ b/components/sbm-support-boot/testcode/empty-project/expected/src/test/java/org/springframework/sbm/SpringBootAppTest.java @@ -1,4 +1,4 @@ -package com.boot.migrator; +package org.springframework.sbm; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/components/sbm-support-boot/testcode/multi-module-simple/expected/module1/pom.xml b/components/sbm-support-boot/testcode/multi-module-simple/expected/module1/pom.xml index 531f0f54d..dd06f5ee0 100644 --- a/components/sbm-support-boot/testcode/multi-module-simple/expected/module1/pom.xml +++ b/components/sbm-support-boot/testcode/multi-module-simple/expected/module1/pom.xml @@ -54,6 +54,7 @@ org.springframework.boot spring-boot-maven-plugin + 2.7.3 diff --git a/components/sbm-support-boot/testcode/multi-module-simple/expected/pom.xml b/components/sbm-support-boot/testcode/multi-module-simple/expected/pom.xml index a302aa399..0da9f97a8 100644 --- a/components/sbm-support-boot/testcode/multi-module-simple/expected/pom.xml +++ b/components/sbm-support-boot/testcode/multi-module-simple/expected/pom.xml @@ -36,7 +36,7 @@ org.springframework.boot spring-boot-dependencies - 2.6.3 + 2.7.3 pom import