-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathinitialize-spring-boot-migration.yaml
152 lines (134 loc) · 6.36 KB
/
initialize-spring-boot-migration.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
- name: initialize-spring-boot-migration
order: 100
condition:
type: org.springframework.sbm.java.migration.conditions.HasNoTypeAnnotation
annotation: org.springframework.boot.autoconfigure.SpringBootApplication
description: "Initialize an application as Spring Boot application."
actions:
- type: org.springframework.sbm.build.migration.actions.AddMinimalPomXml
description: Adds a blank pom.xml to the project if none exists.
condition:
type: org.springframework.sbm.common.migration.conditions.NoFileMatchingPathPatternExist
pattern: /**/pom.xml
- type: org.springframework.sbm.build.migration.actions.AddMavenDependencyManagementAction
condition:
type: org.springframework.sbm.build.migration.conditions.NoDependencyExistMatchingRegex
dependencies:
- 'org\.springframework\.boot'
name: "add managed dependency to Maven"
groupId: org.springframework.boot
artifactId: spring-boot-dependencies
version: 2.6.3
dependencyType: pom
scope: import
description: Add Spring Boot dependency management section to buildfile.
detailedDescription: |-
Add Spring Boot Dependency Management
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
- type: org.springframework.sbm.build.migration.actions.AddDependencies
condition:
type: org.springframework.sbm.build.migration.conditions.NoDependencyExistMatchingRegex
dependencies:
- 'org.springframework.boot'
dependencies:
- groupId: org.springframework.boot
artifactId: spring-boot-starter
version: 2.6.3 # OR finds the managed version and ignores this field
- groupId: org.springframework.boot
artifactId: spring-boot-starter-test
version: 2.6.3
scope: test
multiModuleHandler:
type: org.springframework.sbm.build.migration.actions.AddDependenciesToApplicationModules
description: Add spring dependencies 'spring-boot-starter' and 'spring-boot-starter-test'.
detailedDescription: |-
This code snippet is going to be added to the <dependencies> section in pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</groupId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</groupId>
<scope>test</scope>
</dependency>
- type: org.springframework.sbm.build.migration.actions.RemoveDependenciesMatchingRegex
condition:
type: org.springframework.sbm.common.migration.conditions.TrueCondition
dependenciesRegex:
- org\.springframework\:(spring-core|spring-jcl|spring-context|spring-beans|spring-expression|spring-aop)\:.*
- org\.assertj\:assertj-core\:.*
- org\.mockito\:(mockito-core|mockito-junit-jupiter)\:.*
- org\.hamcrest\:hamcrest\:.*
- org\.junit\.jupiter\:(junit-jupiter|junit-jupiter-api|junit-jupiter-engine|junit-jupiter-params)\:.*
- junit\:junit\:.*
- org\.xmlunit\:xmlunit-core\:.*
description: Delete dependencies to artifacts transitively managed by Spring Boot.
detailedDescription: |-
Delete dependencies to artifacts which are transitively managed
by 'spring-boot-starter' and 'spring-boot-starter-test' dependency.
- type: org.springframework.sbm.build.migration.actions.AddMavenPlugin
plugin:
groupId: org.springframework.boot
artifactId: spring-boot-maven-plugin
condition:
type: org.springframework.sbm.build.migration.conditions.MavenPluginDoesNotExist
plugin:
groupId: org.springframework.boot
artifactId: spring-boot-maven-plugin
multiModuleHandler:
type: org.springframework.sbm.build.migration.actions.AddMavenPluginToApplicationModules
description: Add Spring Boot Maven plugin.
detailedDescription: |
Add Spring Boot Maven Plugin:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
- type: org.springframework.sbm.boot.properties.actions.AddSpringBootApplicationPropertiesAction
condition:
type: org.springframework.sbm.boot.properties.conditions.NoSpringBootApplicationPropertiesExists
description: Create application.properties file.
- type: org.springframework.sbm.boot.common.actions.AddSpringBootMainClassAction
condition:
type: org.springframework.sbm.java.migration.conditions.HasNoTypeAnnotation
annotation: 'org.springframework.boot.autoconfigure.SpringBootApplication'
description: Add Spring Boot starter class.
detailedDescription: |-
Add a class to start the Spring Boot Application Context
@SpringBootApplication
public class SpringBootApplicationStarter {
public static void main(String... args) {
SpringApplication.run(SpringBootApplicationStarter.class, args);
}
}
- type: org.springframework.sbm.boot.common.actions.AddSpringBootContextTestClassAction
condition:
type: org.springframework.sbm.java.migration.conditions.HasNoTypeAnnotation
annotation: 'org.springframework.boot.test.context.SpringBootTest'
description: Add initial unit test class to test Spring Boot Application Context startup.
detailedDescription: |-
Add a unit test class to test Spring Boot Application Context loading
@SpringBootTest
public class SpringBootApplicationStarterTests {
@Test
void contextLoads() {
}
}
- type: org.springframework.sbm.build.migration.actions.BuildPackaging
description: Set packaging to 'jar' type if different
packaging: jar