maven项目管理之-06-pom.xml说明

来源:互联网 发布:淘宝的主营业务 编辑:程序博客网 时间:2024/05/18 22:15

最近学习maven相关知识,刚接触学习,仅供记录便于以后查阅,关于maven中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">   <!-- ##############################基本坐标信息-start############################## -->   <modelVersion>4.0.0</modelVersion>     <!-- 指定了当前pom的版本 -->   <groupId>com.bamboo.maven01</groupId>  <!-- groupId的值就是:反写的公司网址.项目名 -->   <artifactId>maven01-core</artifactId>  <!--artifactId的值是:项目名-模块名  -->   <!--      第一个0表示大版本号     第二个0表示分支版本号      第三个0表示小版本号       SNAPSHOT-快照版本       Alpha-内部测试版本       Beta-公测版本       Release-稳定版本       GA-正式发布版本   -->   <version>0.0.1-SNAPSHOT</version>      <!-- 当前工程的版本号 -->      <packaging>jar</packaging> <!--maven项目的打包方式,不指定默认是jar,也可以是其他类型:war、Zip、pom等 -->   <!-- ##############################基本坐标信息-end############################## -->         <!-- ##############################了解信息-start############################## -->   <name></name>  <!-- 项目描述名,产生项目文档的时候才会使用 -->   <url></url>    <!-- 项目地址 -->   <description></description>  <!-- 项目的描述 -->   <developers></developers>    <!-- 开发人员列表 -->   <licenses></licenses>        <!-- 项目许可证 -->   <organization></organization><!-- 组织信息 -->   <!-- ##############################了解信息-end############################## -->         <!-- ##############################重要信息-end############################## -->   <!-- 依赖列表(包含多个依赖项) -->   <dependencies>    <!-- 依赖项(通过坐标等相关信息定位) -->    <dependency>       <!-- 下面是坐标相关信息 -->       <groupId></groupId>       <artifactId></artifactId>       <version></version>       <type></type>   <!-- 依赖构件类型,比如jar、war、pom等 -->       <scope></scope> <!-- 依赖范围,如test,表示构件在测试时依赖有效 -->       <!-- 设置依赖是否可选(true,false),默认false。如果false,表示子项目默认都继承;       如果true,子项目必须显示引入该依赖,声明只给当前项目使用,其他项目依赖当前项目时,这个jar不会传递给其他项目 -->       <optional></optional>        <!-- 排除依赖传递列表(排除依赖项) -->       <exclusions>          <!-- 排除依赖项(通过坐标信息定位)  -->         <exclusion>         </exclusion>       </exclusions>    </dependency>   </dependencies>      <!-- 依赖管理(包含多个依赖列表),主要在父模块中定义,子模块继承 -->   <dependencyManagement>      <dependencies>         <dependency></dependency>      </dependencies>   </dependencyManagement>      <!-- 为构件行为提供相关支持 -->   <build>      <!-- 插件列表(可以包含多个插件项) -->      <plugins>         <!-- 插件项(通过坐标定位) -->         <plugin>         <groupId></groupId>         <artifactId></artifactId>         <version></version>         </plugin>      </plugins>   </build>      <!-- 通常用于子模块对父模块pom的继承 -->   <parent></parent>   <!-- 聚合运行多个maven项目-->   <modules>   <module></module>   </modules>   <!-- ##############################重要信息-end############################## -->   </project>


0 0
原创粉丝点击