Maven的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">
  <!-- pom.xml的当前版本 -->
  <modelVersion>4.0.0</modelVersion>
  <!-- 反写公司网址+项目名 -->
  <groupId>mxl.Maven</groupId>
  <!-- 公司名+模块名 -->
  <artifactId>mxl-parent</artifactId>
  <!-- 
version:第一个数字(0)表示大版本号;第二个数字(0)表示分支版本号;第三个数字(1)表示小版本号

SNAPSTHOT:快照

ALPHA:内部测试

BETA:公测

RELEASE:稳定

GA:正式发布

packaging:包装类型
  -->
  <version>0.0.1-SNAPSHOT</version>
  <!-- 包装类型 -->
  <packaging>jar</packaging>
 <!-- 
name:项目描述名;
url:项目地址
description:项目描述
 -->
  <name>mxl-parent</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
<!-- 依赖项 -->
  <dependencies>
    <dependency>
    <!-- 依赖所在的位置 -->
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <!-- 依赖的版本号 -->
      <version>3.8.1</version>
      <!-- 依赖包所使用的范围 -->
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <!-- dependencyManagement主要是用于给子模块继承要用的依赖,在实际中并不运行 -->
  <dependencyManagement>
    <dependencies></dependencies>
  </dependencyManagement>
  
  <!-- 引入依赖需要的插件 -->
  <build>
    <plugins>
      <groupId></groupId>
      <artifactId></artifactId>
      <version></version>
    </plugins>
  </build>
  
  <!-- 用于子模块对父模块pxm的继承 -->
  <parent></parent>
  
  <!-- 聚合多个模块同时编译 -->
  <modules>
    <module></module>
  </modules>
</project>

猜你喜欢

转载自blog.csdn.net/qq_37909508/article/details/81584607