3.pom.xml文件详解(慕课网)

<?xml version="1.0" encoding="UTF-8"?>

<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">
  <!--maven的版本号-->
  <modelVersion>4.0.0</modelVersion>

  <!--坐标-->
  <groupId>com.steven.maven</groupId><!--公司网址反写+项目名-->
  <artifactId>demo</artifactId><!--项目名+模块名-->
  <version>1.0-SNAPSHOT</version><!--快照版本-->
  <!--
	  0.0.1
	  第一个0表示大版本号
	  第二个0表示分支版本号
	  第三个0表示小版本号
	
	  snapshot    快照
	  alpha       内部测试
	  beta        公测
	  Release     稳定
	  GA          正式发布
  -->	
  
  <!--打包方式-->
  <packaging>jar</packaging><!--打包方式:默认是jar,可选war、zip、pom-->

  <!--项目名称-->
  <name>demo Maven Webapp</name>

  <!--项目地址-->
  <url>http://www.example.com</url>

  <!--项目描述-->
  <description></description>

  <!--开发人员列表-->
  <developers></developers>

  <!--许可证信息-->
  <licenses></licenses>

  <!--组织信息-->
  <organization></organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--指定编码格式-->
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <!--依赖列表-->
  <dependencies>
    <!--依赖项-->
    <dependency>
      <!--使用Junit4(注解方式运行)-->
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope><!--依赖范围-->
      <!--<optional></optional>--> <!--设置依赖是否可选(默认false)-->
      <!--排斥依赖传递列表-->
      <!--
      <exclusions>
          <exclusion>
          </exclusion>
      </exclusions>
      -->
    </dependency>
  </dependencies>
  <!--依赖的管理,作用主要定义在父模块中,对子模块进行管理-->
  <!--
      <dependencyManagement>
          <dependencies>
          </dependencies>
      </dependencyManagement>
  -->
  <!--通常用于子模块对父模块pom的继承-->
  <!--<parent></parent>-->

  <!--对构件的行为提供相应的支持-->
  <build>
    <finalName>demo</finalName>
    <pluginManagement>
      <!--插件列表-->
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.7.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.20.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <!--用来聚合运行Maven项目,指定多个模块一起编译-->
  <!--
      <modules>
          <module></module>
      </modules>
  -->
</project>

猜你喜欢

转载自blog.csdn.net/u010286027/article/details/84848408