From 4251b1c4daff5e3ded7ca55d2a46c324cd952f4e Mon Sep 17 00:00:00 2001 From: Amadeus Date: Fri, 19 Apr 2024 22:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E9=A1=B9=E7=9B=AE=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 33 ++++++++ pom.xml | 78 +++++++++++++++++++ .../example/MyProjectBackendApplication.java | 13 ++++ .../java/com/example/ServletInitializer.java | 13 ++++ src/main/resources/application.yaml | 1 + .../MyProjectBackendApplicationTests.java | 13 ++++ 6 files changed, 151 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/com/example/MyProjectBackendApplication.java create mode 100644 src/main/java/com/example/ServletInitializer.java create mode 100644 src/main/resources/application.yaml create mode 100644 src/test/java/com/example/MyProjectBackendApplicationTests.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..0503bcb --- /dev/null +++ b/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.2.5 + + + com.example + my-project-backend + 0.0.1-SNAPSHOT + war + my-project-backend + my-project-backend + + 17 + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/src/main/java/com/example/MyProjectBackendApplication.java b/src/main/java/com/example/MyProjectBackendApplication.java new file mode 100644 index 0000000..00c9e04 --- /dev/null +++ b/src/main/java/com/example/MyProjectBackendApplication.java @@ -0,0 +1,13 @@ +package com.example; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MyProjectBackendApplication { + + public static void main(String[] args) { + SpringApplication.run(MyProjectBackendApplication.class, args); + } + +} diff --git a/src/main/java/com/example/ServletInitializer.java b/src/main/java/com/example/ServletInitializer.java new file mode 100644 index 0000000..f722785 --- /dev/null +++ b/src/main/java/com/example/ServletInitializer.java @@ -0,0 +1,13 @@ +package com.example; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(MyProjectBackendApplication.class); + } + +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 0000000..fc0d2d3 --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1 @@ +spring.application.name=my-project-backend diff --git a/src/test/java/com/example/MyProjectBackendApplicationTests.java b/src/test/java/com/example/MyProjectBackendApplicationTests.java new file mode 100644 index 0000000..dfe8574 --- /dev/null +++ b/src/test/java/com/example/MyProjectBackendApplicationTests.java @@ -0,0 +1,13 @@ +package com.example; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MyProjectBackendApplicationTests { + + @Test + void contextLoads() { + } + +}