Skip to content

Commit

Permalink
feat(root) 新增 starter-tomcat模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhengjiaao committed Nov 28, 2022
1 parent 087d771 commit 85ca97a
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<!-- <module>starter-security</module>-->
<module>starter-test</module>
<module>starter-thymeleaf</module>
<module>starter-tomcat</module>
<module>starter-validation</module>
<module>starter-web-19000</module>
<module>starter-web-services</module>
Expand Down
56 changes: 56 additions & 0 deletions starter-tomcat/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zja</groupId>
<artifactId>spring-boot-starter-test-root</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>

<groupId>com.zja</groupId>
<artifactId>starter-tomcat</artifactId>
<packaging>jar</packaging>

<dependencies>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-dependencies.version}</version>
<!--<configuration>
&lt;!&ndash;解决 jar 命令启动报错问题:no main manifest attribute, in /app.jar&ndash;&gt;
<mainClass>com.zja.WebApplication</mainClass>
</configuration>-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
21 changes: 21 additions & 0 deletions starter-tomcat/src/main/java/com/zja/TomcatApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @Company: 上海数慧系统技术有限公司
* @Department: 数据中心
* @Author: 郑家骜[ào]
* @Email: [email protected]
* @Date: 2022-11-28 14:20
* @Since:
*/
package com.zja;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TomcatApplication {

public static void main(String[] args) {
SpringApplication.run(TomcatApplication.class, args);
}

}
18 changes: 18 additions & 0 deletions starter-tomcat/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server:
# 可选的,默认值
tomcat:
uri-encoding: UTF-8
accept-count: 100
max-connections: 8192
max-http-form-post-size: 2MB
max-keep-alive-requests: 100
max-swallow-size: 2MB
processor-cache: 200
redirect-context-root: true
resource:
allow-caching: true
threads:
max: 200
min-spare: 10
# connection-timeout:
# keep-alive-timeout:
21 changes: 21 additions & 0 deletions starter-tomcat/src/test/java/com/zja/TomcatApplicationTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @Company: 上海数慧系统技术有限公司
* @Department: 数据中心
* @Author: 郑家骜[ào]
* @Email: [email protected]
* @Date: 2022-11-28 14:24
* @Since:
*/
package com.zja;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class TomcatApplicationTests {

@Test
public void test() {

}
}

0 comments on commit 85ca97a

Please sign in to comment.