<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jeedev.myproj</groupId>
<artifactId>myproj</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>myproj</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>
</project>
|
mvn clean deploy -f pom_jar.xmlhtml
validate:验证工程是否正确,全部须要的资源是否可用。
compile:编译项目的源代码。
test:使用合适的单元测试框架来测试已编译的源代码。这些测试不须要已打包和布署。
Package:把已编译的代码打包成可发布的格式,好比jar。
integration-test:若有须要,将包处理和发布到一个可以进行集成测试的环境。
verify:运行全部检查,验证包是否有效且达到质量标准。
install:把包安装在本地的repository中,能够被其余工程做为依赖来使用。
Deploy:在集成或者发布环境下执行,将最终版本的包拷贝到远程的repository,使得其余的开发者或者工程能够共享。
clean:清除先前构建的artifacts(在maven中,把由项目生成的包都叫做artifact)。
site:为项目生成文档站点。
-Dmaven.test.skip=true 跳过单元测试
|
mvn -f xxx.xml能够指定pom文件进行构建。java
mvn -s /path/to/user/my-settings.xml 指定settings文件git
mvn dependency:purge-local-repository 删除本地仓库github
分析jar包依赖关系web
mvn dependency:analyzespring
mvn dependency:treeapache
mvn dependency:tree > tree.txtwindows
mvn dependency:tree -Dverbose -Dincludes=org.elasticsearch > tree.txttomcat
<build>
<finalName>mywebproj</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>7.0.0.pre5</version>
</plugin>
</plugins>
</build>
|
<build>
<finalName>mywebproj</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>7.0.0.pre5</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
|
相关参数说明app
参数 | 默认值 | 说明 |
---|---|---|
allowSnapshots | false | 是否更新-snapshot快照版 |
artifactId | ${project.artifactId} | 指定artifactId |
generateBackupPoms | true | 是否备份pom文件 |
groupId | ${project.groupId} | 指定groupId |
newVersion | 设置的新版本号 | |
nextSnapshot | false | 更新版本号为下一个快照版本号 |
oldVersion | ${project.version} | 指定须要更新的版本号可使用缺省‘*' |
processAllModules | false | 是否更新目录下全部模块不管是否声明父子节点 |
processDependencies | true | 是否更新依赖其的版本号 |
processParent | true | 是否更新父节点的版本号 |
processPlugins | true | 是否更新插件中的版本号 |
processProject | true | 是否更新模块自身的版本号 |
removeSnapshot | false | 移除snapshot快照版本,使之为release稳定版 |
updateMatchingVersions | true | 是否更新在子模块中显式指定的匹配版本(如/项目/版本)。 |
参考 versions-maven-plugin 命令介绍
http://aijezdm915.iteye.com/blog/1335025 maven Nexus入门指南(图文)
http://blog.csdn.net/wang379275614/article/details/43940259/ Maven仓库—Nexus环境搭建及简单介绍
http://121088825.iteye.com/blog/2337515 速度很快的 Maven 远程仓库(阿里云 nexus 仓库)