Spring 开发 pom.xml 配置文件(通用配置)

因为在打 jar 包时总会出现各种各样莫名其妙的问题,所以本篇博客提供了含有 Java8.0 ,mybatis,mysql,lombok 以及打 jar 包的完整 pom.xml 配置文件,直接复制使用即可

java 复制代码
<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>2.7.17</version>
        <relativePath/>
        <!--  lookup parent from repository  -->
    </parent>
    <groupId>com.bite</groupId>
    <artifactId>blog</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-blog</name>
    <description>博客系统</description>
    <properties>
        <java.version>8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>runtime</scope>
        </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>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter-test</artifactId>
            <version>2.3.1</version>
            <scope>test</scope>
        </dependency>
        <!-- 		jwt依赖 -->
        <!--  https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api  -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.11.5</version>
        </dependency>
        <!--  https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-impl  -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.11.5</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <!--  or jjwt-gson if Gson is preferred  -->
            <version>0.11.5</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
相关推荐
兰亭序咖啡35 分钟前
学透Spring Boot — 010. 单元测试和Spring Test
spring boot·spring·单元测试
侧耳倾听11136 分钟前
单元测试之mockito
java·单元测试
苹果酱056739 分钟前
SpringCloud第二篇:注册中心Eureka
java·vue.js·spring boot·mysql·课程设计
圈圈编码40 分钟前
WebSocket
java·网络·spring boot·websocket·网络协议·spring
szuaudi42 分钟前
SpringMVC实现text/event-stream(SSE)
java·spring
nlog3n1 小时前
Java 桥接模式 详解
java·开发语言·桥接模式
理想奋斗中1 小时前
【并发编程 | 第五篇】探索ThreadLocal的原理
java·多线程·threadlocal·threadlocalmap
李小白661 小时前
JavaEE初阶复习(JVM篇)
java·jvm·java-ee
Easonmax1 小时前
【JavaEE】网络原理详解
java·java-ee
movie__movie1 小时前
Spring AI MCP 客户端实战:轻松连接高德地图等工具
数据库·人工智能·spring