pom.xml常用元素介绍

<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>项目名+模块名</artifactId>

  <!--第一个0表示大版本号

       第二个0表示分支版本号

       第三个0表示小版本号

       0.0.1

       snapshot快照

       alpha内部测试

       beta公测

       Release稳定

       GA正式发布

    -->
  <version>0.0.1-SNAPSHOT</version>

  <!--默认是jar、还有war、zip、pom>
  <packaging>jar</packaging>

  <!--项目描述名>

  <name>hi</name>

  <!--项目地址>
  <url>http://maven.apache.org</url>

  <!--项目描述>

  <description></description>

  <!--开发人员信息>

  <developers></developers>

  <!--许可证信息>

  <licenses></licenses>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <!--依赖信息>

  <dependencies>
    <dependency>
      <groupId></groupId>
      <artifactId></artifactId>
      <version></version>

      <type></type>
      <scope>test</scope>

      <optional>true/false</optional>

      <!--排除依赖列表>

      <exclusions>

            <exclusion></exclusion>

       </exclusions>
    </dependency>
  </dependencies>
  <build>

  <!--插件列表>
      <plugins>
          <plugin>
              <groupId></groupId>
              <artifactId></artifactId>
              <version></version>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals>
                           <goal>jar-no-fork</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
      </plugins>
  </build>

  <parent></parent>

  <modules></modules>
</project>

猜你喜欢

转载自blog.csdn.net/u011702479/article/details/81952498