Skip to content

Commit a858cd6

Browse files
committed
adjusts
1 parent 074088d commit a858cd6

File tree

16 files changed

+407
-611
lines changed

16 files changed

+407
-611
lines changed

generators/spring-boot/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ ${classProperties
700700
};
701701
source.addMavenPluginRepository?.(springRepository);
702702
source.addMavenRepository?.(springRepository);
703-
source.addSpringBootModule(['spring-boot-properties-migrator']);
703+
source.addSpringBootModule?.(['spring-boot-properties-migrator']);
704704
}
705705
if (application.jhipsterDependenciesVersion?.endsWith('-SNAPSHOT')) {
706706
source.addMavenRepository?.({

generators/spring-boot/generators/jwt/__snapshots__/generator.spec.ts.snap

Lines changed: 20 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22

33
exports[`generator - spring-boot:jwt reactive(false)-skipUserManagement(false) should call source snapshot 1`] = `
44
{
5-
"addJavaDefinition": [
6-
{
7-
"dependencies": [
8-
{
9-
"artifactId": "spring-boot-starter-security",
10-
"groupId": "org.springframework.boot",
11-
},
12-
{
13-
"artifactId": "spring-boot-starter-oauth2-resource-server",
14-
"groupId": "org.springframework.boot",
15-
},
16-
],
17-
},
5+
"addSpringBootModule": [
6+
[
7+
"spring-boot-starter-security",
8+
"spring-boot-starter-oauth2-resource-server",
9+
],
1810
],
1911
}
2012
`;
@@ -59,19 +51,11 @@ exports[`generator - spring-boot:jwt reactive(false)-skipUserManagement(false) s
5951

6052
exports[`generator - spring-boot:jwt reactive(false)-skipUserManagement(true) should call source snapshot 1`] = `
6153
{
62-
"addJavaDefinition": [
63-
{
64-
"dependencies": [
65-
{
66-
"artifactId": "spring-boot-starter-security",
67-
"groupId": "org.springframework.boot",
68-
},
69-
{
70-
"artifactId": "spring-boot-starter-oauth2-resource-server",
71-
"groupId": "org.springframework.boot",
72-
},
73-
],
74-
},
54+
"addSpringBootModule": [
55+
[
56+
"spring-boot-starter-security",
57+
"spring-boot-starter-oauth2-resource-server",
58+
],
7559
],
7660
}
7761
`;
@@ -119,19 +103,11 @@ exports[`generator - spring-boot:jwt reactive(false)-skipUserManagement(true) sh
119103

120104
exports[`generator - spring-boot:jwt reactive(true)-skipUserManagement(false) should call source snapshot 1`] = `
121105
{
122-
"addJavaDefinition": [
123-
{
124-
"dependencies": [
125-
{
126-
"artifactId": "spring-boot-starter-security",
127-
"groupId": "org.springframework.boot",
128-
},
129-
{
130-
"artifactId": "spring-boot-starter-oauth2-resource-server",
131-
"groupId": "org.springframework.boot",
132-
},
133-
],
134-
},
106+
"addSpringBootModule": [
107+
[
108+
"spring-boot-starter-security",
109+
"spring-boot-starter-oauth2-resource-server",
110+
],
135111
],
136112
}
137113
`;
@@ -176,19 +152,11 @@ exports[`generator - spring-boot:jwt reactive(true)-skipUserManagement(false) sh
176152

177153
exports[`generator - spring-boot:jwt reactive(true)-skipUserManagement(true) should call source snapshot 1`] = `
178154
{
179-
"addJavaDefinition": [
180-
{
181-
"dependencies": [
182-
{
183-
"artifactId": "spring-boot-starter-security",
184-
"groupId": "org.springframework.boot",
185-
},
186-
{
187-
"artifactId": "spring-boot-starter-oauth2-resource-server",
188-
"groupId": "org.springframework.boot",
189-
},
190-
],
191-
},
155+
"addSpringBootModule": [
156+
[
157+
"spring-boot-starter-security",
158+
"spring-boot-starter-oauth2-resource-server",
159+
],
192160
],
193161
}
194162
`;

generators/spring-boot/generators/jwt/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class JwtGenerator extends SpringBootApplicationGenerator {
9595
get postWriting() {
9696
return this.asPostWritingTaskGroup({
9797
dependencies({ source }) {
98-
source.addSpringBootModule(['spring-boot-starter-security', 'spring-boot-starter-oauth2-resource-server']);
98+
source.addSpringBootModule?.(['spring-boot-starter-security', 'spring-boot-starter-oauth2-resource-server']);
9999
},
100100
});
101101
}

generators/spring-boot/generators/oauth2/__snapshots__/generator.spec.ts.snap

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ exports[`generator - spring-boot:oauth2 with defaults options should call source
99
"artifactId": "caffeine",
1010
"groupId": "com.github.ben-manes.caffeine",
1111
},
12-
{
13-
"artifactId": "spring-boot-starter-oauth2-client",
14-
"groupId": "org.springframework.boot",
15-
},
16-
{
17-
"artifactId": "spring-boot-starter-oauth2-resource-server",
18-
"groupId": "org.springframework.boot",
19-
},
2012
],
2113
},
2214
],
15+
"addSpringBootModule": [
16+
[
17+
"spring-boot-starter-oauth2-client",
18+
"spring-boot-starter-oauth2-resource-server",
19+
],
20+
],
2321
}
2422
`;
2523

@@ -73,17 +71,15 @@ exports[`generator - spring-boot:oauth2 with reactive should call source snapsho
7371
"artifactId": "caffeine",
7472
"groupId": "com.github.ben-manes.caffeine",
7573
},
76-
{
77-
"artifactId": "spring-boot-starter-oauth2-client",
78-
"groupId": "org.springframework.boot",
79-
},
80-
{
81-
"artifactId": "spring-boot-starter-oauth2-resource-server",
82-
"groupId": "org.springframework.boot",
83-
},
8474
],
8575
},
8676
],
77+
"addSpringBootModule": [
78+
[
79+
"spring-boot-starter-oauth2-client",
80+
"spring-boot-starter-oauth2-resource-server",
81+
],
82+
],
8783
}
8884
`;
8985

generators/spring-boot/generators/oauth2/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class Oauth2Generator extends SpringBootApplicationGenerator {
108108
get postWriting() {
109109
return this.asPostWritingTaskGroup({
110110
dependencies({ source }) {
111-
source.addSpringBootModule(['spring-boot-starter-oauth2-client', 'spring-boot-starter-oauth2-resource-server']);
111+
source.addSpringBootModule?.(['spring-boot-starter-oauth2-client', 'spring-boot-starter-oauth2-resource-server']);
112112
source.addJavaDefinition!({
113113
dependencies: [{ groupId: 'com.github.ben-manes.caffeine', artifactId: 'caffeine' }],
114114
});

generators/spring-boot/generators/websocket/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class SpringBootWebsocketGenerator extends SpringBootApplicationG
4646
get postWriting() {
4747
return this.asPostWritingTaskGroup({
4848
addDependencies({ source }) {
49-
source.addSpringBootModule(['spring-boot-starter-websocket']);
49+
source.addSpringBootModule?.(['spring-boot-starter-websocket']);
5050
source.addJavaDependencies?.([{ groupId: 'org.springframework.security', artifactId: 'spring-security-messaging' }]);
5151
},
5252
});

generators/spring-boot/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ export type Source = JavaSource &
8787
/**
8888
* Add a Spring Boot Module to dependencies.
8989
*/
90-
addSpringBootModule(moduleName: SpringBootModule[]): void;
90+
addSpringBootModule?(moduleName: SpringBootModule[]): void;
9191
/**
9292
* Override a property defined in Spring Boot Dependencies POM.
9393
*/
94-
overrideProperty({ property, value }: { property: SpringBootModule; value: string }): void;
94+
overrideProperty?({ property, value }: { property: SpringBootModule; value: string }): void;
9595
/**
9696
* @example
9797
* addApplicationPropertiesClass({

0 commit comments

Comments
 (0)