spring-boot4-skill 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -0
- package/bin/create-spring-app.js +48 -0
- package/lib/generator.js +188 -0
- package/lib/prompts.js +115 -0
- package/lib/templates.js +45 -0
- package/package.json +44 -0
- package/skills/java-spring-framework/SKILL.md +56 -0
- package/skills/java-spring-framework/references/build-templates.md +304 -0
- package/skills/java-spring-framework/references/spring-boot-4.md +347 -0
- package/skills/java-spring-framework/references/spring-framework-7.md +314 -0
- package/skills/java-spring-framework/references/spring-modulith.md +220 -0
- package/skills-lock.json +20 -0
- package/templates/gradle-kotlin/build.gradle.kts.template +113 -0
- package/templates/gradle-kotlin/compose.yaml.template +40 -0
- package/templates/gradle-kotlin/settings.gradle.kts.template +1 -0
- package/templates/gradle-kotlin/src/main/java/com/example/app/Application.java.template +19 -0
- package/templates/gradle-kotlin/src/main/resources/application.yaml.template +60 -0
- package/templates/gradle-kotlin/src/test/java/com/example/app/ApplicationTests.java.template +17 -0
- package/templates/maven/pom.xml.template +159 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package {{packageName}};
|
|
2
|
+
|
|
3
|
+
import org.jspecify.annotations.NullMarked;
|
|
4
|
+
import org.springframework.boot.SpringApplication;
|
|
5
|
+
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* {{appName}} — Spring Boot {{bootVersion}} / Java {{javaVersion}} / Jakarta EE 11
|
|
9
|
+
*
|
|
10
|
+
* Generated by create-spring-boot4 ({{year}})
|
|
11
|
+
*/
|
|
12
|
+
@NullMarked
|
|
13
|
+
@SpringBootApplication(proxyBeanMethods = false)
|
|
14
|
+
public class {{appName}}Application {
|
|
15
|
+
|
|
16
|
+
public static void main(String[] args) {
|
|
17
|
+
SpringApplication.run({{appName}}Application.class, args);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
spring:
|
|
2
|
+
application:
|
|
3
|
+
name: {{projectName}}
|
|
4
|
+
|
|
5
|
+
{{#if hasJpa}} datasource:
|
|
6
|
+
url: jdbc:postgresql://localhost:5432/{{projectName}}
|
|
7
|
+
username: ${DB_USERNAME:app}
|
|
8
|
+
password: ${DB_PASSWORD:secret}
|
|
9
|
+
hikari:
|
|
10
|
+
maximum-pool-size: 20
|
|
11
|
+
minimum-idle: 5
|
|
12
|
+
|
|
13
|
+
jpa:
|
|
14
|
+
hibernate:
|
|
15
|
+
ddl-auto: validate
|
|
16
|
+
open-in-view: false
|
|
17
|
+
properties:
|
|
18
|
+
hibernate:
|
|
19
|
+
format_sql: true
|
|
20
|
+
{{/if}}
|
|
21
|
+
|
|
22
|
+
{{#if hasMongo}} data:
|
|
23
|
+
mongodb:
|
|
24
|
+
uri: ${MONGODB_URI:mongodb://localhost:27017/{{projectName}}}
|
|
25
|
+
{{/if}}
|
|
26
|
+
|
|
27
|
+
{{#if hasDockerCompose}} docker:
|
|
28
|
+
compose:
|
|
29
|
+
enabled: true
|
|
30
|
+
lifecycle-management: start-and-stop
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
threads:
|
|
34
|
+
virtual:
|
|
35
|
+
enabled: true # Project Loom virtual threads
|
|
36
|
+
|
|
37
|
+
server:
|
|
38
|
+
port: 8080
|
|
39
|
+
shutdown: graceful
|
|
40
|
+
|
|
41
|
+
{{#if hasActuator}}management:
|
|
42
|
+
endpoints:
|
|
43
|
+
web:
|
|
44
|
+
exposure:
|
|
45
|
+
include: health,info,metrics,prometheus,traces
|
|
46
|
+
tracing:
|
|
47
|
+
sampling:
|
|
48
|
+
probability: 1.0
|
|
49
|
+
otlp:
|
|
50
|
+
metrics:
|
|
51
|
+
export:
|
|
52
|
+
url: ${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:http://localhost:4318/v1/metrics}
|
|
53
|
+
tracing:
|
|
54
|
+
endpoint: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:http://localhost:4318/v1/traces}
|
|
55
|
+
{{/if}}
|
|
56
|
+
|
|
57
|
+
logging:
|
|
58
|
+
level:
|
|
59
|
+
root: INFO
|
|
60
|
+
{{packageName}}: DEBUG
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package {{packageName}};
|
|
2
|
+
|
|
3
|
+
import org.junit.jupiter.api.Test;
|
|
4
|
+
import org.springframework.boot.test.context.SpringBootTest;
|
|
5
|
+
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Smoke test — verifies the Spring context loads successfully.
|
|
9
|
+
*/
|
|
10
|
+
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
|
11
|
+
class {{appName}}ApplicationTests {
|
|
12
|
+
|
|
13
|
+
@Test
|
|
14
|
+
void contextLoads() {
|
|
15
|
+
// Spring context must start without errors
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
|
5
|
+
https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
6
|
+
<modelVersion>4.0.0</modelVersion>
|
|
7
|
+
|
|
8
|
+
<parent>
|
|
9
|
+
<groupId>org.springframework.boot</groupId>
|
|
10
|
+
<artifactId>spring-boot-starter-parent</artifactId>
|
|
11
|
+
<version>{{bootVersion}}</version>
|
|
12
|
+
<relativePath/>
|
|
13
|
+
</parent>
|
|
14
|
+
|
|
15
|
+
<groupId>{{packageName}}</groupId>
|
|
16
|
+
<artifactId>{{projectName}}</artifactId>
|
|
17
|
+
<version>0.0.1-SNAPSHOT</version>
|
|
18
|
+
<description>{{description}}</description>
|
|
19
|
+
|
|
20
|
+
<properties>
|
|
21
|
+
<java.version>{{javaVersion}}</java.version>
|
|
22
|
+
<jspecify.version>1.0.0</jspecify.version>
|
|
23
|
+
{{#if hasModulith}} <spring-modulith.version>2.0.3</spring-modulith.version>
|
|
24
|
+
{{/if}} </properties>
|
|
25
|
+
|
|
26
|
+
{{#if hasModulith}} <dependencyManagement>
|
|
27
|
+
<dependencies>
|
|
28
|
+
<dependency>
|
|
29
|
+
<groupId>org.springframework.modulith</groupId>
|
|
30
|
+
<artifactId>spring-modulith-bom</artifactId>
|
|
31
|
+
<version>${spring-modulith.version}</version>
|
|
32
|
+
<scope>import</scope>
|
|
33
|
+
<type>pom</type>
|
|
34
|
+
</dependency>
|
|
35
|
+
</dependencies>
|
|
36
|
+
</dependencyManagement>
|
|
37
|
+
{{/if}}
|
|
38
|
+
|
|
39
|
+
<dependencies>
|
|
40
|
+
<!-- Web -->
|
|
41
|
+
{{#if hasWebFlux}} <dependency>
|
|
42
|
+
<groupId>org.springframework.boot</groupId>
|
|
43
|
+
<artifactId>spring-boot-starter-webflux</artifactId>
|
|
44
|
+
</dependency>
|
|
45
|
+
{{/if}}
|
|
46
|
+
{{#if !hasWebFlux}} <dependency>
|
|
47
|
+
<groupId>org.springframework.boot</groupId>
|
|
48
|
+
<artifactId>spring-boot-starter-web</artifactId>
|
|
49
|
+
</dependency>
|
|
50
|
+
{{/if}}
|
|
51
|
+
|
|
52
|
+
{{#if hasJpa}} <!-- Data -->
|
|
53
|
+
<dependency>
|
|
54
|
+
<groupId>org.springframework.boot</groupId>
|
|
55
|
+
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
56
|
+
</dependency>
|
|
57
|
+
<dependency>
|
|
58
|
+
<groupId>org.springframework.boot</groupId>
|
|
59
|
+
<artifactId>spring-boot-starter-jdbc</artifactId>
|
|
60
|
+
</dependency>
|
|
61
|
+
<dependency>
|
|
62
|
+
<groupId>{{dbMavenDep}}</groupId>
|
|
63
|
+
</dependency>
|
|
64
|
+
{{/if}}
|
|
65
|
+
|
|
66
|
+
{{#if hasValidation}} <!-- Validation -->
|
|
67
|
+
<dependency>
|
|
68
|
+
<groupId>org.springframework.boot</groupId>
|
|
69
|
+
<artifactId>spring-boot-starter-validation</artifactId>
|
|
70
|
+
</dependency>
|
|
71
|
+
{{/if}}
|
|
72
|
+
|
|
73
|
+
{{#if hasSecurity}} <!-- Security -->
|
|
74
|
+
<dependency>
|
|
75
|
+
<groupId>org.springframework.boot</groupId>
|
|
76
|
+
<artifactId>spring-boot-starter-security</artifactId>
|
|
77
|
+
</dependency>
|
|
78
|
+
<dependency>
|
|
79
|
+
<groupId>org.springframework.boot</groupId>
|
|
80
|
+
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
|
|
81
|
+
</dependency>
|
|
82
|
+
{{/if}}
|
|
83
|
+
|
|
84
|
+
{{#if hasActuator}} <!-- Observability -->
|
|
85
|
+
<dependency>
|
|
86
|
+
<groupId>org.springframework.boot</groupId>
|
|
87
|
+
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
88
|
+
</dependency>
|
|
89
|
+
<dependency>
|
|
90
|
+
<groupId>io.micrometer</groupId>
|
|
91
|
+
<artifactId>micrometer-tracing-bridge-otel</artifactId>
|
|
92
|
+
</dependency>
|
|
93
|
+
<dependency>
|
|
94
|
+
<groupId>io.opentelemetry</groupId>
|
|
95
|
+
<artifactId>opentelemetry-exporter-otlp</artifactId>
|
|
96
|
+
</dependency>
|
|
97
|
+
{{/if}}
|
|
98
|
+
|
|
99
|
+
<!-- Null Safety -->
|
|
100
|
+
<dependency>
|
|
101
|
+
<groupId>org.jspecify</groupId>
|
|
102
|
+
<artifactId>jspecify</artifactId>
|
|
103
|
+
<version>${jspecify.version}</version>
|
|
104
|
+
</dependency>
|
|
105
|
+
|
|
106
|
+
{{#if hasModulith}} <!-- Spring Modulith -->
|
|
107
|
+
<dependency>
|
|
108
|
+
<groupId>org.springframework.modulith</groupId>
|
|
109
|
+
<artifactId>spring-modulith-starter-core</artifactId>
|
|
110
|
+
</dependency>
|
|
111
|
+
{{/if}}
|
|
112
|
+
|
|
113
|
+
<!-- Testing -->
|
|
114
|
+
<dependency>
|
|
115
|
+
<groupId>org.springframework.boot</groupId>
|
|
116
|
+
<artifactId>spring-boot-starter-test</artifactId>
|
|
117
|
+
<scope>test</scope>
|
|
118
|
+
</dependency>
|
|
119
|
+
{{#if hasModulith}} <dependency>
|
|
120
|
+
<groupId>org.springframework.modulith</groupId>
|
|
121
|
+
<artifactId>spring-modulith-starter-test</artifactId>
|
|
122
|
+
<scope>test</scope>
|
|
123
|
+
</dependency>
|
|
124
|
+
{{/if}}
|
|
125
|
+
</dependencies>
|
|
126
|
+
|
|
127
|
+
<build>
|
|
128
|
+
<plugins>
|
|
129
|
+
<plugin>
|
|
130
|
+
<groupId>org.springframework.boot</groupId>
|
|
131
|
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
132
|
+
</plugin>
|
|
133
|
+
<plugin>
|
|
134
|
+
<groupId>org.apache.maven.plugins</groupId>
|
|
135
|
+
<artifactId>maven-compiler-plugin</artifactId>
|
|
136
|
+
<configuration>
|
|
137
|
+
{{#if enablePreview}} <compilerArgs>
|
|
138
|
+
<arg>--enable-preview</arg>
|
|
139
|
+
</compilerArgs>
|
|
140
|
+
{{/if}} </configuration>
|
|
141
|
+
</plugin>
|
|
142
|
+
</plugins>
|
|
143
|
+
</build>
|
|
144
|
+
|
|
145
|
+
{{#if hasNative}} <profiles>
|
|
146
|
+
<profile>
|
|
147
|
+
<id>native</id>
|
|
148
|
+
<build>
|
|
149
|
+
<plugins>
|
|
150
|
+
<plugin>
|
|
151
|
+
<groupId>org.graalvm.buildtools</groupId>
|
|
152
|
+
<artifactId>native-maven-plugin</artifactId>
|
|
153
|
+
</plugin>
|
|
154
|
+
</plugins>
|
|
155
|
+
</build>
|
|
156
|
+
</profile>
|
|
157
|
+
</profiles>
|
|
158
|
+
{{/if}}
|
|
159
|
+
</project>
|