Maven pom.xml标签含义

Maven中pom.xml里标签的含义

POM全称 Project Object Model 项目对象模型


<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>com.ouyang.maven</groupId>
  <!--模块标识,实际项目的模块(项目名+模块名)-->
  <artifactId>maven-test</artifactId>
  <!--
  第一个0大版本号,第二个0表示分支版本号,第三个0表示小版本号 
  SNAPSHOT 快照
  ALPHA 内部测试
  BETA 公测
  RELEASE 稳定
  GA 正式发布
-->
  <version>0.0.1-SNAPSHOT</version>
  <!-- 默认是jar   war zip pom -->
  <packaging>jar</packaging>
<!-- 项目的描述名 -->
  <name>maven-test</name>
  <!-- 项目的地址 -->
  <url>http://maven.apache.org</url>
  <!-- 项目描述 -->
  <description></description>
  <!-- 开发人员 -->
  <developers></developers>
  <!-- 许可证 -->
  <licenses></licenses>
  <!-- 组织信息 -->
  <organization></organization>
  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <!-- 
      	依赖范围   
      	compile 默认的范围,编译测试运行都有效
		provided 在编译测试时有效
		runtime 测试和运行时有效
		test 测试时有效
		system 在编译测试时有效(需要与本地系统做关联)
		import 导入的范围,只做用dependcyManagement中,表示从其他的pom中导入dependecy的配置
      -->
      <scope>test</scope>
      <!-- 依赖是否可选 -->
      <!-- <optional>false</optional> -->
      <!-- 排除依赖传递列表 -->
      <exclusions>
      	<!-- <exclusion>
          <groupId></groupId>
          <artifactId></artifactId>
        </exclusion> -->
      </exclusions>
    </dependency>
  </dependencies>
  <!-- 依赖管理(可以提供父依赖)-->
  <dependencyManagement>
  	<!-- <dependencies>
  		<dependency></dependency>
  	</dependencies> -->
  </dependencyManagement>
  
  <build>
    <!-- 插件列表 -->
  	<plugins>
  		<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>
  </build>
  <!-- 在子模块中对父模块pom的继承 -->
  <!-- <parent></parent> -->
  <!-- 聚合多个运行的maven项-->
  <!-- <modules></modules> -->
</project>


  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值