From 7552b0a524ed73d00c99cdde2e3c6d6a718ae59d Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 16 七月 2024 11:02:34 +0800 Subject: [PATCH] 添加配置文件 --- src/main/java/com/se/simu/SimuApplication.java | 6 +++ src/main/resources/application-dev.yml | 26 +++++++++++++ src/main/resources/application-prod.yml | 26 +++++++++++++ pom.xml | 21 ++++++++++ 4 files changed, 79 insertions(+), 0 deletions(-) diff --git a/pom.xml b/pom.xml index 24dec46..811dc2c 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,7 @@ <version>2.7.18</version> <relativePath/> </parent> + <packaging>jar</packaging> <groupId>com.se</groupId> <artifactId>simu</artifactId> @@ -114,12 +115,32 @@ </dependency> </dependencies> + <profiles> + <profile> + <id>dev</id> + <properties> + <activatedProperties>dev</activatedProperties> + </properties> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + <profile> + <id>prod</id> + <properties> + <activatedProperties>prod</activatedProperties> + </properties> + </profile> + </profiles> + <build> + <finalName>simu</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> + <mainClass>com.se.simu.SimuApplication</mainClass> <excludes> <exclude> <groupId>org.projectlombok</groupId> diff --git a/src/main/java/com/se/simu/SimuApplication.java b/src/main/java/com/se/simu/SimuApplication.java index 144e60b..0ce7a55 100644 --- a/src/main/java/com/se/simu/SimuApplication.java +++ b/src/main/java/com/se/simu/SimuApplication.java @@ -4,6 +4,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +/** + * 鍚姩绋嬪簭绫� + * + * @author WWW + * @date 2024-07-16 + */ @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.se.simu"}) public class SimuApplication { public static void main(String[] args) { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..1a85cef --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,26 @@ +server: + tomcat: + uri-encoding: UTF-8 + max-connections: 5000 + max-http-form-post-size: 50MB + threads: + max: 2000 + port: 8079 + servlet: + context-path: /simuserver + +spring: + mvc: + pathmatch: + # 瑙e喅Knife4j杩愯鎶ラ敊 + matching-strategy: ant_path_matcher + application: + name: simuserver + +knife4j: + # 鏄惁寮�鍚� + enabled: true + # 璇锋眰鍓嶇紑 + pathMapping: + # 鏄惁寮�鍚寮烘ā寮� + enable: true diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..1a85cef --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,26 @@ +server: + tomcat: + uri-encoding: UTF-8 + max-connections: 5000 + max-http-form-post-size: 50MB + threads: + max: 2000 + port: 8079 + servlet: + context-path: /simuserver + +spring: + mvc: + pathmatch: + # 瑙e喅Knife4j杩愯鎶ラ敊 + matching-strategy: ant_path_matcher + application: + name: simuserver + +knife4j: + # 鏄惁寮�鍚� + enabled: true + # 璇锋眰鍓嶇紑 + pathMapping: + # 鏄惁寮�鍚寮烘ā寮� + enable: true -- Gitblit v1.9.3