Skip to content

Commit 7840ee3

Browse files
authored
Merge branch 'main' into 585-move-auto-config-registration-to-new-upgrade-report
2 parents 38062c0 + fa35eee commit 7840ee3

File tree

39 files changed

+190
-151
lines changed

39 files changed

+190
-151
lines changed

applications/spring-boot-upgrade/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.springframework.sbm</groupId>
2222
<artifactId>spring-boot-migrator</artifactId>
23-
<version>0.12.1-SNAPSHOT</version>
23+
<version>0.13.1-SNAPSHOT</version>
2424
<relativePath>../../pom.xml</relativePath>
2525
</parent>
2626

@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>org.springframework.sbm</groupId>
3434
<artifactId>sbm-recipes-boot-upgrade</artifactId>
35-
<version>0.12.1-SNAPSHOT</version>
35+
<version>0.13.1-SNAPSHOT</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.springframework.boot</groupId>

applications/spring-shell/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.springframework.sbm</groupId>
2323
<artifactId>spring-boot-migrator</artifactId>
24-
<version>0.12.1-SNAPSHOT</version>
24+
<version>0.13.1-SNAPSHOT</version>
2525
<relativePath>../../pom.xml</relativePath>
2626
</parent>
2727

@@ -32,27 +32,27 @@
3232
<dependency>
3333
<groupId>org.springframework.sbm</groupId>
3434
<artifactId>sbm-recipes-spring-framework</artifactId>
35-
<version>0.12.1-SNAPSHOT</version>
35+
<version>0.13.1-SNAPSHOT</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.springframework.sbm</groupId>
3939
<artifactId>sbm-recipes-jee-to-boot</artifactId>
40-
<version>0.12.1-SNAPSHOT</version>
40+
<version>0.13.1-SNAPSHOT</version>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.springframework.sbm</groupId>
4444
<artifactId>sbm-core</artifactId>
45-
<version>0.12.1-SNAPSHOT</version>
45+
<version>0.13.1-SNAPSHOT</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>org.springframework.sbm</groupId>
4949
<artifactId>sbm-recipes-mule-to-boot</artifactId>
50-
<version>0.12.1-SNAPSHOT</version>
50+
<version>0.13.1-SNAPSHOT</version>
5151
</dependency>
5252
<dependency>
5353
<groupId>org.springframework.sbm</groupId>
5454
<artifactId>sbm-recipes-spring-cloud</artifactId>
55-
<version>0.12.1-SNAPSHOT</version>
55+
<version>0.13.1-SNAPSHOT</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>org.springframework.boot</groupId>
@@ -75,7 +75,7 @@
7575
<dependency>
7676
<groupId>org.springframework.sbm</groupId>
7777
<artifactId>test-helper</artifactId>
78-
<version>0.12.1-SNAPSHOT</version>
78+
<version>0.13.1-SNAPSHOT</version>
7979
<scope>test</scope>
8080
</dependency>
8181
<dependency>
@@ -111,12 +111,12 @@
111111
<dependency>
112112
<groupId>org.springframework.sbm</groupId>
113113
<artifactId>sbm-support-weblogic</artifactId>
114-
<version>0.12.1-SNAPSHOT</version>
114+
<version>0.13.1-SNAPSHOT</version>
115115
</dependency>
116116
<dependency>
117117
<groupId>org.springframework.sbm</groupId>
118118
<artifactId>sbm-recipes-boot-upgrade</artifactId>
119-
<version>0.12.1-SNAPSHOT</version>
119+
<version>0.13.1-SNAPSHOT</version>
120120
</dependency>
121121
</dependencies>
122122

components/openrewrite-spring-recipes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>org.springframework.sbm</groupId>
2121
<artifactId>spring-boot-migrator</artifactId>
22-
<version>0.12.1-SNAPSHOT</version>
22+
<version>0.13.1-SNAPSHOT</version>
2323
<relativePath>../../pom.xml</relativePath>
2424
</parent>
2525
<artifactId>openrewrite-spring-recipes</artifactId>

components/recipe-test-support/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>spring-boot-migrator</artifactId>
2121
<groupId>org.springframework.sbm</groupId>
22-
<version>0.12.1-SNAPSHOT</version>
22+
<version>0.13.1-SNAPSHOT</version>
2323
<relativePath>../../pom.xml</relativePath>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
@@ -62,7 +62,7 @@
6262
<dependency>
6363
<groupId>org.springframework.sbm</groupId>
6464
<artifactId>sbm-core</artifactId>
65-
<version>0.12.1-SNAPSHOT</version>
65+
<version>0.13.1-SNAPSHOT</version>
6666
<type>test-jar</type>
6767
<scope>compile</scope>
6868
</dependency>

components/sbm-core/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>spring-boot-migrator</artifactId>
2121
<groupId>org.springframework.sbm</groupId>
22-
<version>0.12.1-SNAPSHOT</version>
22+
<version>0.13.1-SNAPSHOT</version>
2323
<relativePath>../../pom.xml</relativePath>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>org.springframework.sbm</groupId>
3232
<artifactId>sbm-openrewrite</artifactId>
33-
<version>0.12.1-SNAPSHOT</version>
33+
<version>0.13.1-SNAPSHOT</version>
3434
</dependency>
3535

3636
<dependency>
@@ -101,7 +101,7 @@
101101
<dependency>
102102
<groupId>org.eclipse.jgit</groupId>
103103
<artifactId>org.eclipse.jgit</artifactId>
104-
<version>6.3.0.202209071007-r</version>
104+
<version>6.4.0.202211300538-r</version>
105105
</dependency>
106106
<!-- hibernate validator -->
107107
<dependency>
@@ -150,7 +150,7 @@
150150
<dependency>
151151
<groupId>org.springframework.sbm</groupId>
152152
<artifactId>sbm-openrewrite</artifactId>
153-
<version>0.12.1-SNAPSHOT</version>
153+
<version>0.13.1-SNAPSHOT</version>
154154
<classifier>tests</classifier>
155155
<scope>test</scope>
156156
</dependency>

components/sbm-core/src/main/java/org/springframework/sbm/build/impl/RewriteMavenParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public List<Xml.Document> parse(String... sources) {
7575
@Override
7676
public List<Xml.Document> parse(ExecutionContext ctx, String... sources) {
7777
mavenSettingsInitializer.initializeMavenSettings(ctx);
78-
parser.parse(ctx, sources);
79-
return Parser.super.parse(ctx, sources);
78+
return parser.parse(ctx, sources);
8079
}
8180

8281
/**

components/sbm-core/src/test/java/org/springframework/sbm/build/impl/MavenSettingsInitializerTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.nio.file.Path;
2626

2727
import static org.assertj.core.api.Assertions.assertThat;
28-
import static org.junit.jupiter.api.Assertions.*;
2928

3029
/**
3130
* @author Fabian Krüger
@@ -72,14 +71,22 @@ void mavenParserMustAdhereToSettingsXmlTest() throws URISyntaxException {
7271
MavenRepository localRepository = mavenExecutionContextView.getLocalRepository();
7372
assertThat(localRepository.isSnapshots()).isTrue();
7473

75-
// assertThat(localRepository.getUri()).isEqualTo("file:" + fakedUserHome + "/.m2/repository/");
76-
assertThat(localRepository.getUri()).isEqualTo(MavenRepository.MAVEN_LOCAL_DEFAULT.getUri());
74+
String tmpDir = removeTrailingSlash(System.getProperty("java.io.tmpdir"));
75+
String customLocalRepository = new URI("file://" + tmpDir).toString();
76+
assertThat(removeTrailingSlash(localRepository.getUri())).isEqualTo(customLocalRepository);
7777
assertThat(localRepository.isSnapshots()).isTrue();
7878
assertThat(localRepository.isKnownToExist()).isTrue();
7979
assertThat(localRepository.getUsername()).isNull();
8080
assertThat(localRepository.getPassword()).isNull();
8181
}
8282

83+
String removeTrailingSlash(String string) {
84+
if(string.endsWith("/")){
85+
return string.substring(0, string.length()-1);
86+
}
87+
return string;
88+
}
89+
8390
@AfterEach
8491
public void reset() {
8592
// reset

components/sbm-core/src/test/java/org/springframework/sbm/build/impl/RewriteMavenParserTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ void customExecutionContextGiven() {
4949
String pom = PomBuilder.buildPom("com.example:project:1.0").build();
5050
ExecutionContext ctx = new RewriteExecutionContext();
5151
sut.parse(ctx, pom);
52-
// first time when initializing the parser
53-
// second time in the parse method to guarantee ExecutionContext is enriched with MavenSettings
54-
verify(mavenSettingsInitializer, times(2)).initializeMavenSettings(ctx);
52+
verify(mavenSettingsInitializer).initializeMavenSettings(ctx);
5553
}
5654

5755
}

components/sbm-core/src/test/java/org/springframework/sbm/build/util/PomBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ public static PomBuilder buildParentPom(String parentCoordinate, String coordina
6161
return pomBuilder;
6262
}
6363

64+
/**
65+
* Create a root {@code pom.xml} with a parent, e.g. spring-boot-starter-parent
66+
*/
67+
public static PomBuilder buildRootWithParent(String parentCoordinate, String pomCoordinate) {
68+
PomBuilder pomBuilder = new PomBuilder();
69+
pomBuilder.parentPom = parentCoordinate;
70+
pomBuilder.coordinate = pomCoordinate;
71+
return pomBuilder;
72+
}
73+
6474
/**
6575
* Add modules to a pom.
6676
*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.m2/repository/
2+
.config
3+
.rewrite

components/sbm-core/testcode/project-with-maven-settings/user-home/.m2/settings.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
33
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
44

5+
<localRepository>${java.io.tmpdir}</localRepository>
56
<profiles>
67
<profile>
7-
<activeByDefault>true</activeByDefault>
8+
<activation>
9+
<activeByDefault>true</activeByDefault>
10+
</activation>
811
<repositories>
912
<repository>
1013
<snapshots>

components/sbm-openrewrite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.springframework.sbm</groupId>
2323
<artifactId>spring-boot-migrator</artifactId>
24-
<version>0.12.1-SNAPSHOT</version>
24+
<version>0.13.1-SNAPSHOT</version>
2525
<relativePath>../../pom.xml</relativePath>
2626
</parent>
2727

0 commit comments

Comments
 (0)