add servlet init

This commit is contained in:
dzj 2023-12-18 06:41:44 +08:00
parent ae178da88f
commit 7d7084f763
2 changed files with 54 additions and 35 deletions

81
pom.xml
View File

@ -3,47 +3,50 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.risesoft</groupId>
<artifactId>demo01</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>demo01</name>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version> <version>3.2.0</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>net.risesoft</groupId>
<artifactId>demo01</artifactId>
<version>1.0</version>
<name>demo01</name>
<description>Demo project for Spring Boot</description>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories> <repositories>
<pluginRepository> <repository>
<id>spring-snapshots</id> <id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url> <url>https://repo.spring.io/snapshot</url>
</pluginRepository> <snapshots>
<pluginRepository> <enabled>true</enabled>
<id>spring-milestones</id> </snapshots>
<url>https://repo.spring.io/milestone</url> </repository>
</pluginRepository> <repository>
</pluginRepositories> <id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
<properties> <properties>
<java.version>21</java.version> <java.version>21</java.version>
<spring-cloud.version>2023.0.0-RC1</spring-cloud.version> <spring-cloud.version>2023.0.0</spring-cloud.version>
</properties> </properties>
<!--<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
@ -53,7 +56,7 @@
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement>--> </dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
@ -64,6 +67,12 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<!--<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>-->
</dependency> </dependency>
<dependency> <dependency>
@ -98,9 +107,19 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId> <artifactId>spring-cloud-starter-consul-discovery</artifactId>
<version>4.0.3</version>
</dependency> </dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!--<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
</dependency>-->
</dependencies> </dependencies>
<build> <build>

View File

@ -7,7 +7,7 @@ management:
exposure: exposure:
include: '*' include: '*'
server: server:
port: 7055 port: 7099
servlet: servlet:
context-path: /demo01 context-path: /demo01
encoding: encoding:
@ -33,7 +33,7 @@ spring:
compatibility-verifier: compatibility-verifier:
enabled: false enabled: false
consul: consul:
host: host.docker.internal host: localhost
port: 8500 port: 8500
discovery: discovery:
register-health-check: true register-health-check: true
@ -46,7 +46,7 @@ spring:
tags: test,y9 tags: test,y9
datasource: datasource:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://host.docker.internal:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://localhost:3306/y9_public?serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&useUnicode=true&characterEncoding=utf-8&rewriteBatchedStatements=true&useCompression=true&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: '12345678' password: '12345678'
hikari: hikari:
@ -68,7 +68,7 @@ spring:
allow-circular-references: false allow-circular-references: false
docker: docker:
compose: compose:
enabled: true enabled: false
file: compose-dev.yml file: compose-dev.yml
readiness: readiness:
#wait: NEVER #wait: NEVER