maven的pom.xml的讲解
2016-12-18 21:11
302 查看
<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的版本号 --> <modelVersion>4.0.0</modelVersion> <!--反写公司网址 + 项目名 --> <groupId>com.misssad.HelloMiss</groupId> <!-- 项目名 + 模块名 --> <artifactId>Hi</artifactId> <!-- 第一个 0 大版本号 第二个 0 表示分支版本号 第三个0表示小版本号 snapshot 快照 alpha 内部测试 beta 公测 Release 稳定 GA正式发布 --> <version>0.0.1-SNAPSHOT</version> <!-- 默认是jar war --> <packaging>jar</packaging> <!-- 项目名 --> <name>Hi</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> <!-- 排除依赖传递列表 --> <exclusions> <exclusion></exclusion> </exclusions> </dependency> </dependencies> <!--依赖管理 一般用于父模块中 比如吧Junit放到父模块中,让子模块去继承 --> <dependencyManagement> <dependencies> <dependency></dependency> </dependencies> </dependencyManagement> <!--一般是对构建行为进行处理,用的比较多的就是plugins标签 比如下面就使用到了maven的source插件,使其在打包时, 将源码也进行打包--> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <!-- 在什么时候执行上面的插件 --> <executions> <execution> <id>attach-sources</id> <!-- 在打包的时候,执行 --> <phase>package</phase> <!-- 执行的目标是打成jar --> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <!-- 用于子模块中说明继承哪个父模块 --> <parent> <groupId>1</groupId> <artifactId>1</artifactId> <version>1</version> </parent> <!-- 可以同时编译多个模块 --> <modules> <module></module> </modules> </project>
相关文章推荐
- maven pom.xml配置讲解一
- Maven核心pom.xml讲解(转)
- Maven讲解之 POM.XML
- MAVEN系列之二@编写POM.xml和讲解
- maven pom.xml配置讲解
- maven的pom.xml配置文件讲解
- 关于Maven pom.xml中的元素modules、parent、properties以及import讲解推荐博客
- maven pom.xml 详细配置讲解
- maven中pom.xml中的scope讲解
- maven中pom.xml中的scope讲解
- maven中打包项目为war包的pom.xml配置
- MyEclipse 配置maven项目pom.xml设置 上传项目到nexus私服,通过中转仓库下载插件,以及nexus的配置
- Maven 下 pom.xml中schema 报错
- 相关 maven 依赖(pom.xml 文件)
- SpringMVC框架+thymeleaf的Maven配置文件pom.xml
- Eclipse&Maven导入Maven项目后在pom.xml出现"Missing artifact org.springframework:spring-jdbc:jar:3.2.4.RELEAS"
- maven项目连接hbase中pom.xml
- 根据已有项目jar文件生成maven的pom.xml
- [maven2]maven2下pom.xml的json-lib的配置
- Maven学习详解(13)——Maven常用命令大全与pom文件讲解