Spring Boot项目中pom.xml文件各标签详解

Spring Boot项目中pom.xml文件各标签详解

  • 前言
  • pom.xml文件配置的demo

前言

在Spring Boot工程中,pom.xml文件是maven项目的配置基础,它让我们的项目自动导入了很多相关的依赖,下面以我曾经开发过的一个简单项目中的pom.xml文件为例,对文件配置进行部分注释。

pom.xml文件配置的demo









<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.0modelVersion>




    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.6.0version>
        <relativePath/>
        
    parent>




    <groupId>com.upc.pipelinegroupId>


    <artifactId>pdfsartifactId>


    <version>0.0.1-SNAPSHOTversion>


    <name>pdfsname>


    <description>Demo project for Spring Bootdescription>


    <properties>

        <java.version>1.8java.version>
    properties>








    <dependencies>
    

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-thymeleafartifactId>
        dependency>


        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>


        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>8.0.21version>
            <scope>runtimescope>
        dependency>


        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-jdbcartifactId>
        dependency>


        <dependency>
            <groupId>org.projectlombokgroupId>
            <artifactId>lombokartifactId>
            <optional>trueoptional>
        dependency>


        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-testartifactId>
            <scope>testscope>
        dependency>


        <dependency>
            <groupId>org.mybatis.spring.bootgroupId>
            <artifactId>mybatis-spring-boot-starterartifactId>
            <version>2.1.4version>
        dependency>


        <dependency>
            <groupId>com.github.pagehelpergroupId>
            <artifactId>pagehelperartifactId>
            <version>4.1.0version>
        dependency>


        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>fastjsonartifactId>
            <version>1.2.38version>
        dependency>



        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-devtoolsartifactId>
            <optional>trueoptional>
            <scope>runtimescope>
        dependency>
    dependencies>






    <build>

        <plugins>


            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombokgroupId>
                            <artifactId>lombokartifactId>
                        exclude>
                    excludes>
                configuration>
            plugin>
        plugins>
    build>

project>

你可能感兴趣的:(Spring,Boot,spring,boot,xml,java)