Skip to content

Commit 9c131a8

Browse files
committed
switch to spring boot 3
1 parent 86dc1a9 commit 9c131a8

File tree

13 files changed

+26
-25
lines changed

13 files changed

+26
-25
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subprojects {
2727

2828
plugins.withId('pmd') {
2929
pmd {
30-
toolVersion = '6.29.0'
30+
toolVersion = '6.50.0'
3131
ignoreFailures = false
3232
consoleOutput = false
3333
}
@@ -47,7 +47,7 @@ subprojects {
4747

4848
plugins.withId('checkstyle') {
4949
checkstyle {
50-
toolVersion = '8.37'
50+
toolVersion = '10.3.4'
5151
ignoreFailures = false
5252
showViolations = false
5353
}
@@ -62,14 +62,14 @@ subprojects {
6262
exclude '**/stream/**'
6363
}
6464
dependencies {
65-
checkstyle 'com.thomasjensen.checkstyle.addons:checkstyle-addons:6.0.1'
66-
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.38.0'
65+
checkstyle 'com.thomasjensen.checkstyle.addons:checkstyle-addons:7.0.1'
66+
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.43.0'
6767
}
6868
}
6969

7070
plugins.withId('com.github.spotbugs') {
7171
spotbugs {
72-
toolVersion = '4.1.4'
72+
toolVersion = '4.7.2'
7373
ignoreFailures = false
7474
effort = 'max'
7575
reportLevel = 'low'

cli/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ plugins {
33
id 'maven-publish'
44
id 'pmd'
55
id 'checkstyle'
6-
id 'com.github.spotbugs' version '4.6.0'
7-
id 'com.github.johnrengelman.shadow' version '7.1.0'
6+
id 'com.github.spotbugs' version '5.0.13'
7+
id 'com.github.johnrengelman.shadow' version '7.1.2'
88
}
99

1010
dependencies {
11-
implementation 'org.slf4j:slf4j-simple:1.7.32'
12-
implementation 'info.picocli:picocli:4.6.1'
11+
implementation 'org.slf4j:slf4j-simple:1.7.36'
12+
implementation 'info.picocli:picocli:4.7.0'
1313
implementation project(':lib')
1414
}
1515

gradle/lint/pmd/ruleSetMain.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<exclude name="UseObjectForClearerAPI"/>
5050
<exclude name="NPathComplexity"/>
5151
<exclude name="GodClass"/>
52+
<exclude name="CognitiveComplexity"/>
5253
</rule>
5354
<rule ref="category/java/documentation.xml">
5455
<exclude name="CommentRequired"/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

lib/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@ plugins {
22
id 'java-library'
33
id 'pmd'
44
id 'checkstyle'
5-
id 'com.github.spotbugs' version '4.6.0'
5+
id 'com.github.spotbugs' version '5.0.13'
66
}
77

88
dependencies {
99
implementation 'com.google.guava:guava:31.0.1-jre'
10-
// override to support https://github.com/jknack/handlebars.java/pull/893/files
11-
runtimeOnly 'com.github.jknack:handlebars:4.3.0'
12-
// TODO upgrade to support inheritance
13-
api('io.swagger.codegen.v3:swagger-codegen-generators:1.0.30') {
10+
api('io.swagger.codegen.v3:swagger-codegen-generators:1.0.36') {
1411
exclude group: 'io.swagger', module: 'swagger-codegen'
1512
exclude module: 'guava'
1613
exclude module: 'logback-classic'
1714
exclude module: 'logback-core'
1815
}
19-
api('org.openapitools:openapi-generator:5.3.0') {
16+
api('org.openapitools:openapi-generator:6.2.1') {
2017
exclude module: 'guava'
2118
exclude module: 'slf4j-simple'
2219
}
@@ -25,5 +22,5 @@ dependencies {
2522
exclude module: 'guava'
2623
}
2724
testImplementation 'junit:junit:4.13.2'
28-
testImplementation 'org.slf4j:slf4j-simple:1.7.32'
25+
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
2926
}

lib/src/main/java/com/github/slamdev/openapispringgenerator/lib/generator/FormattedTemplateEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public FormattedTemplateEngine(CodegenConfig config) {
1919
@Override
2020
public String getRendered(String templateFile, Map<String, Object> templateData) throws IOException {
2121
String content = super.getRendered(templateFile, templateData);
22-
if (templateFile.endsWith("spring.factories.mustache")) {
22+
if (templateFile.endsWith("AutoConfiguration.imports.mustache")) {
2323
return content;
2424
}
2525
try {

lib/src/main/java/com/github/slamdev/openapispringgenerator/lib/generator/SpringCodegen.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void processOpts() {
4545
super.processOpts();
4646
apiTemplateFiles.put("api.mustache", ".java");
4747
if (Arrays.asList("client", "producer").contains(getLibrary())) {
48-
supportingFiles.add(new SupportingFile("spring.factories.mustache", "META-INF", "spring.factories"));
48+
supportingFiles.add(new SupportingFile("org.springframework.boot.autoconfigure.AutoConfiguration.imports.mustache", "META-INF/spring", "org.springframework.boot.autoconfigure.AutoConfiguration.imports"));
4949
}
5050
modelTemplateFiles.put("model.mustache", ".java");
5151
modelDocTemplateFiles.remove("model_doc.mustache");
@@ -151,6 +151,9 @@ protected void postProcessAllCodegenModels(Map<String, CodegenModel> allModels)
151151
@Override
152152
public void preprocessOpenAPI(OpenAPI openAPI) {
153153
super.preprocessOpenAPI(openAPI);
154+
if (openAPI.getPaths().isEmpty()) {
155+
supportingFiles.removeIf(f -> "org.springframework.boot.autoconfigure.AutoConfiguration.imports.mustache".equals(f.templateFile));
156+
}
154157
if (!isStream()) {
155158
return;
156159
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#apiInfo.apis.0}}{{#apiInfo.apis}}{{package}}.{{classname}}{{#hasMore}}\n{{/hasMore}}{{/apiInfo.apis}}{{/apiInfo.apis.0}}

lib/src/main/resources/handlebars/springcodegen/libraries/client/spring.factories.mustache

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#apiInfo.apis.0}}{{#apiInfo.apis}}{{package}}.{{classname}}{{#hasMore}}\n{{/hasMore}}{{/apiInfo.apis}}{{/apiInfo.apis.0}}

0 commit comments

Comments
 (0)