看注释————

pom.xml

 <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.alanlee</groupId>
<artifactId>UidpWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <!-- maven属性的使用 -->
<properties>
<plugin.version>2.5</plugin.version>
</properties> <!-- 依赖配置的使用 -->
<dependencies> <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<!-- 测试范围有效,在编译和打包时都不会使用这个依赖 -->
<scope>test</scope>
</dependency> <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<!-- 在编译和测试的过程有效,最后生成war包时不会加入 -->
<scope>provided</scope>
</dependency> <dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<!-- 在编译和测试的过程有效,最后生成war包时不会加入 -->
<scope>provided</scope>
</dependency> </dependencies> <!-- 用来支持项目发布到私服中,用来配合deploy插件的使用 -->
<distributionManagement>
<!-- 发布版本 -->
<repository>
<id>releases</id>
<name>public</name>
<url>http://10.200.11.21:8081/nexus/content/repositories/releases/</url>
</repository>
<!-- 快照版本 -->
<snapshotRepository>
<id>snapshots</id>
<name>Snapshots</name>
<url>http://10.200.11.21:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement> <!-- 注意体会插件配置的顺序,这正体现了一个maven的运行流程 -->
<build>
<plugins>
<!-- 插件使用练习 -->
<!-- 清理插件的使用,maven3.0.4会默认使用2.4.1版本的clean插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${plugin.version}</version>
<executions>
<execution>
<id>auto-clean</id>
<!-- clean生命周期clean阶段 -->
<phase>clean</phase>
<goals>
<!-- 执行clean插件的clean目标 -->
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin> <!-- maven-resources-plugin在maven3.0.4中默认使用2.5版本的resources --> <!-- 编译插件的使用,maven3.0.4会默认使用2.3.2版本的compile插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.version}</version>
<configuration>
<!-- 源代码使用的jdk版本 -->
<source>1.7</source>
<!-- 构建后生成class文件jdk版本 -->
<target>1.7</target>
</configuration>
</plugin> <!-- maven-surefire-plugin插件,maven3.0.4默认使用2.10版本的surefire插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${plugin.version}</version>
<configuration>
<!-- 改变测试报告生成目录 ,默认为target/surefire-reports-->
<!-- project.build.directory表示maven的属性,这里指的是构建的目录下面test-reports,project.build.directory就是pom标签的值 -->
<reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
</configuration>
</plugin> <!-- war包插件的使用,maven3.0.4会默认使用xxx版本的war插件,建议配置编码格式和打包名称 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<!-- 利用属性传递版本号 -->
<version>${plugin.version}</version>
<configuration>
<!-- 设置编码 -->
<encoding>UTF-8</encoding>
<!-- 设置名称 -->
<warName>ROOT</warName>
</configuration>
</plugin> <!-- maven-install-plugin插件一般不需要配置,maven3.0.4默认使用2.3.1版本的install插件 --> <!-- 部署插件的使用,maven3.0.4会默认使用2.7版本的deploy插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${plugin.version}</version>
<configuration>
<!-- 更新元数据 -->
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin> </plugins>
</build> </project>

from: http://www.cnblogs.com/AlanLee/p/6428859.html

最新文章

  1. (转) 从0开始搭建SQL Server AlwaysOn 第三篇(配置AlwaysOn)
  2. 在 CentOS7 上部署 MySQL 主从
  3. Input钱币规范化
  4. Java正则获取邮箱
  5. PHP如何实现页面静态化
  6. HDU 1505 City Game (hdu1506 dp二维加强版)
  7. MyEclipse开发JAX-RS架构WebServices收发JSON数据格式
  8. Error building results for action sayHello in namespace /inteceptor -
  9. JMeter的基本介绍和入门
  10. QF——UITableViewCell性能优化(视图复用机制)
  11. JAVA 创建TXT文件,写入文件内容,读取文件内容
  12. Loadrunner脚本录制注意事项(七)
  13. 一次Redis 的性能测试和问题
  14. Ionic2生成的main.js执行时间10s+
  15. MySQL环境变量的配置
  16. 周杰伦的2000w个故事
  17. Object对象的浅拷贝与深拷贝方法详解
  18. 我发起了一个 .Net 平台上的 开源项目 知识图谱 Babana Map 和 文本文件搜索引擎 Babana Search
  19. Modbus RTU 协议使用汇总
  20. cookie操作:设置cookie、读取cookie、删除cookie

热门文章

  1. 记一次对python反弹shell的分析
  2. Hystrix熔断器(六)
  3. 二维树状数组+差分【p4514】上帝造题的七分钟
  4. RabbitMQ (二) 简单队列
  5. 分享Kali Linux 2017年第29周镜像文件
  6. 【状压DP】旅行商问题
  7. 【pb_ds】bzoj1056 [HAOI2008]排名系统/bzoj1862 [Zjoi2006]GameZ游戏排名系统
  8. centos7下解决python3和python2同时存在但是无法使用pip3的问题
  9. [CF627D]Preorder Test
  10. 十. 图形界面(GUI)设计7.文本框和文本区的输入输出