springboot的pom.xml/application.yaml基本配置纪录

该博客介绍了如何在Spring Boot应用中集成阿里云OSS SDK和腾讯云COS STS Java SDK,同时配置了Fastjson、Thymeleaf、Mybatis、HTTP客户端以及数据库连接池等依赖。还涉及了Spring Boot与Undertow的使用,以及MySQL数据源和JPA的配置。此外,提到了开发工具如Spring DevTools和Lombok的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

pom.xml

	<dependencies>
		<!-- 阿里云 -->
		<dependency>
			<groupId>com.aliyun.oss</groupId>
			<artifactId>aliyun-sdk-oss</artifactId>
			<version>2.8.3</version>
		</dependency>
		<!-- 腾讯云 -->
		<dependency>
			<groupId>com.tencent.cloud</groupId>
			<artifactId>cos-sts-java</artifactId>
			<version>3.0.8</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.47</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-thymeleaf</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>    
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
		</dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-undertow</artifactId>
        </dependency>

		<dependency>
			<groupId>org.mybatis.spring.boot</groupId>
			<artifactId>mybatis-spring-boot-starter</artifactId>
			<version>2.1.4</version>
		</dependency>

		<dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.2</version>
        </dependency>

		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
			<version>3.1</version>
		</dependency>

		<dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.56</version>
        </dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
		
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-configuration-processor</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

application.yaml

spring:
    profiles:
        active: dev
    datasource:  # 配置mysql
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: 数据库地址
        username: 数据库账户
        password: 数据库密码
        hikari:
            auto-commit: true
            #空闲连接超时时长
            idle-timeout: 60000
            #连接超时时长
            connection-timeout: 60000
            #最大生命周期,0不过期
            max-lifetime: 0
            #最小空闲连接数
            minimum-idle: 10
            #最大连接数量
            maximum-pool-size: 10
    jpa:
        hibernate:
            ddl-auto: validate
        show-sql: true
    jackson:
        date-format: yyyy-MM-dd HH:mm:ss
        time-zone: GMT+8
server:
    port: 9050
    servlet:
        context-path: /地址
    undertow:
        io-threads: 4
        worker-threads: 20
        buffer-size: 1024
        direct-buffers: true
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值