Java backend frameworks and common dependencies

Published 2026-07-27 09:43 Updated 2026-10-13 17:14 763 words 4 min read ... Page views Co-written with AI I wrote it; AI helped shape ideas and wording. AI-reviewed An AI proof-read this post, but it still deserves a careful read.

AI-reviewed An AI proof-read this post, but it still deserves a careful read.

This article provides an overview of the commonly used technology stacks in Java backend development, focusing on the Maven project configuration based on Spring Boot. Efficient configuration of database connections and data access is achieved by configuring the MySQL database, Druid connection pool, and MyBatis-Plus persistence layer framework in the src/main/resources/application.yml file.

Java backend frameworks and common dependencies

Overview of technology stack

technical fieldrelated technologiesmajor role
Java basic environmentJava 17Provides a compilation and execution environment for Java backend programs
Core development frameworkSpring FrameworkProvide basic capabilities such as IoC, DI, AOP, and transaction management
application development frameworkSpring BootStreamline configuration, dependency management, launch and deployment of Spring applications
Web developmentSpring MVCResponsible for HTTP request processing, parameter binding, controller invocation and response data return
data persistenceMyBatisResponsible for mapping between Java objects and SQL statements
Persistence layer enhancementMyBatis-PlusProvides functions such as universal CRUD, conditional constructor, and paging based on MyBatis
relational databaseMySQLUsed to store and manage business data
database connection poolDruidManage database connections and provide connection pool monitoring and SQL statistics
safety certificationSpring SecurityAchieve user authentication, rights control and request security management
identity tokenJWT、JJWTImplement token-based stateless authentication
interface documentOpenAPI、Knife4jAutomatically generate interface documents and provide interface viewing and online debugging functions
JSON processingJacksonComplete the conversion between Java objects and JSON data
log managementSLF4J、Logback、Log4j 2Record program running status, debugging information and exception information
Code simplificationLombokReduce duplicate code such as Getter, Setter, and constructor through annotations
interface designRESTfulDesign backend interfaces using HTTP methods and resource path specifications
project buildMavenManage project dependencies and complete build tasks such as compilation, testing, and packaging
development AssistantSpring Boot DevToolsProvides development stage assistance functions such as automatic restart
testing supportSpring Boot TestProvide relevant components required for unit testing and integration testing

Spring Boot project

Maven project configuration

<?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>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.hyxy</groupId>
    <artifactId>springboot-demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springboot-demo</name>
    <description>springboot-demo</description>
    <url/>
    <licenses>
        <license/>
    </licenses>
    <developers>
        <developer/>
    </developers>
    <scm>
        <connection/>
        <developerConnection/>
        <tag/>
        <url/>
    </scm>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <!-- Spring MVC、REST Controller、内置 Tomcat -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        <!-- 配置提示 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- 热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <!-- SpringBoot3 适配核心依赖 -->
        <!-- MyBatisPlus 适配SpringBoot3 专属依赖 -->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
            <version>3.5.6</version>
        </dependency>
        <!-- MySQL 驱动 -->
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-3-starter</artifactId>
            <version>1.2.23</version>
        </dependency>
        <!-- lombok 简化实体类 -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- SpringBoot3 测试依赖 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
            <version>4.4.0</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.12.5</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.12.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>0.12.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

database configuration

in src/main/resources/application.yml Configure MySQL, Druid, and MyBatis-Plus in.

spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      url: jdbc:mysql://localhost:33066/java2601?serverTimezone=UTC&characterEncoding=utf8
      username: root
      password: 123456
      driver-class-name: com.mysql.cj.jdbc.Driver
      max-active: 10
      min-idle: 3
      initial-size: 2
      max-wait: 10000
mybatis-plus:
  # xml映射文件的位置
  mapper-locations: classpath*:/mapper/**/*.xml
  # 实体类别名 包
  type-aliases-package: com.hyxy.mp.entity
  configuration:
    # 开启下划线转驼峰自动映射
    map-underscore-to-camel-case: true
    # 开启SQL日志打印
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      # 主键自增策略
      id-type: auto
      # 数据库表前缀(可选)
      # table-pre x: tb_
      # 逻辑删除全局配置
#      logic-delete-field: deleteFlag
#      logic-delete-value: 1 # 已删除
#      logic-not-delete-value: 0 # 未删除
# Knife4j 核心配置(SpringBoot3 通用)
knife4j:
  # 开启增强模式(解锁全部高级功能,必开)
  enable: true
  # 生产环境开关(true=生产关闭文档,false=开发开启)
  production: false
  # UI个性化配置
  setting:
  # 开启暗黑模式
  enable-dark-mode: true
  # 开启接口搜索
  enable-search: true
  # 显示参数长度
  enable-param-length: true
  # 开启接口显示排序
  enable-api-sort: true

jwt:
  secret: l06rIAxOHwGDnjGUvN5XhVIyW4PGQzy4Eff+GFwZTA=
  expire-ms: 3600000

Written by Co-written with AI

If you enjoyed this, leave a comment~

Loading...