pom.xml

pom.xml的基础元素,通过该元素管理项目对第三方包的一些依赖。Maven会根据你在这个元素中定义的一些包的依赖下载到本地仓库,并让项目使用。保证我们的项目能正确的构建和布署。dependencies下有dependency元素,指定项目依赖的某个包。

dependency元素说明
groupId, artifactId,version:引用的包的groupId, artifactId, version
type:指定依赖的这个项目类型,是jar包还是其他类型的包,默认为jar。 
optional: 如果只是为了满足本项目编译, 或者在运行时不需要该包时, 可以将optional设为true, 那么如果再有其他项目引用本项目时, 这个包将不依赖进来。
classifier:用于区别jdk的版本,有些包用不同的jdk,并有不同的后缀让我们选择,我们可以加上这个分类器。例如:bouncycastle/bcprov-jdk15/135/bcprov-jdk15-135.jar

systemPath:用于指定包的具体所在位置。当scope为system时设置。
scope:该依赖所适用的范围。scope有如下的值:
compile,默认值,适用于所有阶段,会随着项目一起发布。 
provided,类似compile,期望容器或使用者会提供这个依赖。
runtime,只在运行时使用,如JDBC驱动,适用运行和测试阶段。 编译时不会使用该包。
test,只在测试时使用,用于编译和运行测试代码。不会随项目发布。 
system,类似provided,需要显式提供包含依赖的jar,maven不会在Repository中查找它,将会去systemPath中查找。并不会随项目发布。 

 

<!-- 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/maven-v4_0_0.xsd"> 
	<modelVersion>4.0.0</modelVersion><!-- 指明POM使用的对象模型的版本,这个值很少改动。 -->
	<groupId>YGBX_ESB</groupId>       <!-- 指明创建项目的组织或者小组的唯一标识 -->
	<artifactId>EADT</artifactId>     <!-- 指明此项目产生的主要产品的基本名称 -->
	<packaging>war</packaging>        <!-- maven 的打包方式  -->
	<version>0.0.1-SNAPSHOT</version> <!-- 项目产品的版本号,SNAPSHOT版本处于开发-->
	<name>EADT Maven Webapp</name>    <!-- 项目的显示名称,通常用于maven产生的文档 --> 
	<url>http://maven.apache.org</url><!-- 指定项目站点,通常用于maven产生的文档中。-->

	<repositories><!--私服的jar文件储存仓库,此私服没有需要的jar文件,去中央仓库寻找-->
		<repository>
			<id>nexus</id>
			<name>Team Nexus Repository</name>
			<url>http://localhost:8081/nexus/content/groups/public</url>
		</repository>
	</repositories>


	<pluginRepositories> <!--私服的插件jar文件储存仓库,如若。。  -->
		<pluginRepository>
			<id>nexus</id>
			<name>Team Nexus Repository</name>
			<url>http://localhost:8081/nexus/content/groups/public</url>
		</pluginRepository>
	</pluginRepositories>


	<properties>
		<junit.version>4.10</junit.version>
		<logback.version>1.1.2</logback.version>
		<oracle.jdbc.version>11.2.0.4.0</oracle.jdbc.version>
		<hibernate.version>3.6.10.Final</hibernate.version>
		<commons.fileupload.version>1.2.1</commons.fileupload.version>
		<javassist.version>3.12.1.GA</javassist.version>
		<spring.version>3.0.2.RELEASE</spring.version>
		<mybatis.version>3.2.8</mybatis.version>
		<mybatis.spring.version>1.2.1</mybatis.spring.version>
		<struts2.version>2.3.20</struts2.version>
		<commons.beanutils>1.9.2</commons.beanutils>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies><!--项目依赖的某个包  -->
		<!-- 推送客户端信息,保持长连接,建议 webSocket代替 -->
		<dependency>
			<groupId>pushlet</groupId>
			<artifactId>pushlet</artifactId>
			<version>1.0</version>
		</dependency>

		<!-- Servlet Api -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>

		<!-- jsp-api -->
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>

		<!-- POI Excel 表格 -->
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>3.11</version>
		</dependency>

		<!-- JSP标签库 -->
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<version>1.1.2</version>
		</dependency>

		<!-- webService 工具 -->
		<dependency>
			<groupId>axis</groupId>
			<artifactId>axis</artifactId>
			<version>1.4</version>
		</dependency>

		<!-- XML文件解析工具 -->
		<dependency>
			<groupId>jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.1</version>
		</dependency>

		<!-- ActionMq -->
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-core</artifactId>
			<version>5.7.0</version>
		</dependency>

		<!-- mmons项目中封装了各种网络协议的客户端 -->
		<dependency>
			<groupId>commons-net</groupId>
			<artifactId>commons-net</artifactId>
			<version>3.3</version>
		</dependency>

		<!-- ant 编译打包构建工具 -->
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant</artifactId>
			<version>1.9.4</version>
		</dependency>

		<!-- Jetty Util -->
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-util</artifactId>
			<version>9.2.6.v20141205</version>
		</dependency>

		<!-- Struts2 核心包 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-core</artifactId>
			<version>${struts2.version}</version>
		</dependency>

		<!-- Struts2 json包 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-json-plugin</artifactId>
			<version>${struts2.version}</version>
		</dependency>

		<!-- Struts2 单元测试类 -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-junit-plugin</artifactId>
			<version>2.3.20</version>
		</dependency>

		<!-- Ojdbc6.jar -->
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc6</artifactId>
			<version>${oracle.jdbc.version}</version>
		</dependency>

		<!-- 阿里数据库连接池 -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid</artifactId>
			<version>1.0.12</version>
		</dependency>

		<!-- logback 日志文件 -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
		</dependency>


		<!-- MyBatis -->
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
			<version>${mybatis.version}</version>
		</dependency>

		<!-- MyBatis对 Spring集成 的依赖包 -->
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis-spring</artifactId>
			<version>${mybatis.spring.version}</version>
			<!-- <type>zip</type> -->
		</dependency>

		<!-- 模板引擎 -->
		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity</artifactId>
			<version>1.7</version>
		</dependency>

		<!-- Hibernate -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-nop</artifactId>
			<version>1.5.2</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>4.1.9.Final</version>
			<type>jar</type>
		</dependency>

		<!-- Hibernate验证 包 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>5.1.3.Final</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
			<version>1.0.0.Final</version>
		</dependency>

		<dependency>
			<groupId>javax.transaction</groupId>
			<artifactId>jta</artifactId>
			<version>1.1</version>
		</dependency>

		<!-- rapid-framework是一个以spring为核心的项目脚手架(或者称为胶水框架),框架将各个零散的框架(struts,strust2,springmvc,hibernate,ibatis,spring_jdbc,flex)搭建好,并内置一个代码生成器,辅助项目开发,可以生成java的hibernat model,dao,manager,struts+struts2 action类,可以生成jsp的增删改查及列表页面 -->
		<dependency>
			<groupId>com.googlecode.rapid-framework</groupId>
			<artifactId>rapid-generator</artifactId>
			<version>4.0.6</version>
		</dependency>

		<!-- Redis javaAPI -->
		<dependency>
			<groupId>redis.clients</groupId>
			<artifactId>jedis</artifactId>
			<version>2.6.2</version>
		</dependency>

		<!-- quartz 定时任务 -->
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
			<version>2.2.0</version>
		</dependency>

		<!-- junit包 -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>

		<!-- 读取字节码包 -->
		<dependency>
			<groupId>javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>${javassist.version}</version>
		</dependency>

		<!-- spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jms</artifactId>
			<version>${spring.version}</version>
		</dependency>
		
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-instrument</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<!-- 性能不好 更换成 fastjson -->
		<dependency>
			<groupId>net.sf.json-lib</groupId>
			<artifactId>json-lib</artifactId>
			<version>2.4</version>
			<classifier>jdk15</classifier>
		</dependency>

		<dependency>
			<groupId>de.odysseus.staxon</groupId>
			<artifactId>staxon</artifactId>
			<version>1.3</version>
		</dependency>

		<dependency>
			<groupId>net.sf.jasperreports</groupId>
			<artifactId>jasperreports</artifactId>
			<version>4.0.1</version>
		</dependency>

		<dependency>
			<groupId>net.sourceforge.jexcelapi</groupId>
			<artifactId>jxl</artifactId>
			<version>2.6.12</version>
		</dependency>

		<!-- 高性能JSON 处理工具 -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.3</version>
		</dependency>

		<!-- aspectj -->
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.8.4</version>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<version>1.8.4</version>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjlib</artifactId>
			<version>1.6.2</version>
		</dependency>

	</dependencies>

	<build>
		<finalName>EADT</finalName>
		<!--插件 -->
		<plugins>
		   <!-- 編譯插件 -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<!-- 打war包插件 -->
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<version>3.0</version>
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>

			<!-- maven 測試插件 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.7.2</version>
				<configuration>
					<forkMode>once</forkMode>
					<argLine>-Dfile.encoding=UTF-8</argLine>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

 

 详细参考:http://www.blogjava.net/jianyue/articles/227932.html

 

你可能感兴趣的:(pom.xml)