• 笔记:Maven 项目基本配置


    Maven 的基本设置包含项目基本信息和项目信息,基本信息主要用于设置当前包的归属项目、当前项目等,配置文件结构如下:

    <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

    http://maven.apache.org/xsd/maven-4.0.0.xsd">

            <modelVersion>4.0.0</modelVersion>

              

            <!-- 基本设置 -->

            <groupId>项目归属组</groupId>

            <artifactId>项目唯一ID</artifactId>

            <version>版本号</version>

            <packaging>定义打包方式(默认值:jar)</packaging>

            <dependencies>依赖项(具体说明)</dependencies>

            <parent>父项目(具体说明)</parent>

            <dependencyManagement>...</dependencyManagement>

            <modules>...</modules>

    <!-- 设置变量 -->

            <properties>

    <!-- 使用变量时,格式为:${变量名} -->

    <变量名>变量值</变量名>

    </properties>

            <!-- 项目信息设置 -->

            <name>项目名称</name>

            <description>项目描述性文字</description>

            <url>项目的URL地址</url>

            <inceptionYear>项目初始时间</inceptionYear>

            <licenses><!-- 许可协议 -->

         <name>Apache 2</name>

            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>

            <distribution>repo</distribution>

            <comments>A business-friendly OSS license</comments>

            </licenses>

            <organization><!-- 组织 -->

            <name>Codehaus Mojo</name>

            <url>http://mojo.codehaus.org</url>

            </organization>

            <developers><!-- 项目开发人员和角色,一个或者多个 -->

            <developer>

                <id>eric</id>

                <name>Eric</name>

                <email>eredmond@codehaus.org</email>

                <url>http://eric.propellors.net</url>

                <organization>Codehaus</organization>

                <organizationUrl>http://mojo.codehaus.org</organizationUrl>

                <roles><!-- 角色 -->

                   <role>architect</role>

                   <role>developer</role>

                </roles>

                <timezone>-6</timezone><!-- 时区 -->

                <properties>

                   <picUrl>http://tinyurl.com/prv4t</picUrl>

                </properties>

            </developer>

            </developers>

            <contributors>

       

  • 相关阅读:
    单例模式
    json 格式
    axios 获取不到数据错误
    sprint test 添加事务回滚机制
    springboot An incompatible version [1.1.32] of the APR based Apache Tomcat Native library is installed, while Tomcat requires version [1.2.14]
    spring boot 启动之后404
    废了
    tomcat 部署项目到服务器
    Druid 介绍及配置
    jq 全选
  • 原文地址:https://www.cnblogs.com/li3807/p/6416191.html
Copyright © 2020-2023  润新知