当前位置: 代码迷 >> Web前端 >> maven 配备例子
  详细解决方案

maven 配备例子

热度:1178   发布时间:2013-08-10 21:14:06.0
maven 配置例子

<?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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.aa.xx</groupId>
	<artifactId>demo</artifactId>
	<packaging>pom</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>demo</name>
	<description>demoApplication</description>
	<url>http://www.xx.com</url>

	<modules>
		<module>common</module>
		<module>core</module>
		<module>static-data</module>
		<module>messaging</module>
		<module>confirmation</module>
		<module>integration-test</module>
		<module>job</module>
		<module>web</module>
		<module>system-test</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<sonar.dynamicAnalysis>true</sonar.dynamicAnalysis>
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<maven.test.failure.ignore>true</maven.test.failure.ignore>
		<exclude.tests>nothing</exclude.tests>
		<spring.integration.version>2.2.4.RELEASE</spring.integration.version>
		<spring.framework.version>3.2.4.RELEASE</spring.framework.version>
		<spring.oxm.version>3.2.2.RELEASE</spring.oxm.version>
		<hibernate.version>4.2.3.Final</hibernate.version>
		<hibernate.annotation.version>3.2.0.Final</hibernate.annotation.version>
		<jackson.version>1.9.2</jackson.version>
		<easymock.version>2.5.2</easymock.version>
		<org.slf4j>1.7.5</org.slf4j>
		<ibmmq.version>5.3.07</ibmmq.version>
		<struts.version>2.3.15</struts.version>
		<demo.version>0.0.1-SNAPSHOT</demo.version>
		<xx.functional.env>http://xxx</xx.functional.env>

	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>sonar-maven-plugin</artifactId>
				<version>2.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</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-deploy-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.13</version>
				<configuration>
					<argLine>-Xms512m -Xmx1024m</argLine>
					<encoding>UTF-8</encoding>
					<excludes>
						<exclude>${exclude.tests}</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>

		<profile>
			<id>fast</id>
			<properties>
				<exclude.tests>com/xx/system/**/*Test.java</exclude.tests>
			</properties>
		</profile>
		<profile>
			<id>read-properties</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>properties-maven-plugin</artifactId>
						<version>1.0-alpha-2</version>
						<executions>
							<execution>
								<phase>initialize</phase>
								<goals>
									<goal>read-project-properties</goal>
								</goals>
								<configuration>
									<files>
										<file>${basedir}/../core/src/main/resources/common.properties</file>
										<file>${basedir}/../conf/${app.properties.path}/app.properties</file>
									</files>									
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>coverage-per-test</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>2.13</version>
						<configuration>
							<properties>
								<property>
									<name>listener</name>
									<value>org.sonar.java.jacoco.JUnitListener</value>
								</property>
							</properties>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>aaa</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>2.13</version>
						<configuration>
							<additionalClasspathElements>
								<additionalClasspathElement>${app.properties.path}</additionalClasspathElement>
							</additionalClasspathElements>
							<junitArtifactName>junit:junit</junitArtifactName>
							<excludes>
								<exclude>**/bb/**/*Test.java</exclude>
								<exclude>**/cc/**/*Test.java</exclude>
								<exclude>**/zz/**/*Test.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>st-gg</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>2.13</version>
						<configuration>
							<additionalClasspathElements>
								<additionalClasspathElement>${app.properties.path}</additionalClasspathElement>
							</additionalClasspathElements>
							<junitArtifactName>junit:junit</junitArtifactName>
							<excludes>
								<exclude>**/zz/**/*Test.java</exclude>
								<exclude>**/xx/**/*Test.java</exclude>
								<exclude>**/vv/**/*Test.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		
	</profiles>

	<dependencies>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.googlecode.jmockit</groupId>
			<artifactId>jmockit</artifactId>
			<version>1.2</version>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>org.codehaus.sonar-plugins.java</groupId>
			<artifactId>sonar-jacoco-listeners</artifactId>
			<version>1.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>antlr</groupId>
			<artifactId>antlr</artifactId>
			<version>2.7.7</version>
		</dependency>

		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.6.6</version>
		</dependency>

		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<version>1.6.6</version>
		</dependency>

		<dependency>
			<groupId>cglib</groupId>
			<artifactId>cglib-nodep</artifactId>
			<version>2.2</version>
		</dependency>

		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>3.2</version>
		</dependency>

		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>1.2.2</version>
		</dependency>

		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.2.1</version>
		</dependency>

		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.2</version>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.4</version>
		</dependency>

		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<version>${easymock.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymockclassextension</artifactId>
			<version>${easymock.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.2.125</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-commons-annotations</artifactId>
			<version>${hibernate.annotation.version}</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>${hibernate.version}</version>
			<exclusions>
				<exclusion>
					<groupId>edu.oswego.cs.concurrent</groupId>
					<artifactId>edu.oswego.cs.dl.util.concurrent</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.12.1.GA</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.0-api</artifactId>
			<version>1.0.1.Final</version>
		</dependency>
		<!-- <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> 
			<version>1.0</version> </dependency> -->
		<dependency>
			<groupId>javax.jms</groupId>
			<artifactId>jms</artifactId>
			<version>1.1</version>
		</dependency>

		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
		</dependency>

		<dependency>
			<groupId>ognl</groupId>
			<artifactId>ognl</artifactId>
			<version>3.0.6</version>
		</dependency>

		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>oracle-jdbc</artifactId>
			<version>11.2.0.2.0</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-asm</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-instrument</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jms</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-oxm</artifactId>
			<version>${spring.oxm.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-jms</artifactId>
			<version>${spring.integration.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-jpa</artifactId>
			<version>${spring.integration.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.framework.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-core</artifactId>
			<version>${spring.integration.version}</version>
		</dependency>

		<dependency>
			<groupId>com.ibm</groupId>
			<artifactId>com.ibm.mqjms</artifactId>
			<version>${ibmmq.version}</version>
		</dependency>

		<dependency>
			<groupId>com.ibm</groupId>
			<artifactId>com.ibm.mq</artifactId>
			<version>${ibmmq.version}</version>
			<exclusions>
				<exclusion>
					<groupId>javax.transaction</groupId>
					<artifactId>jta</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${org.slf4j}</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>${org.slf4j}</version>
		</dependency>


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

		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-jpa</artifactId>
			<version>1.3.2.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-json-plugin</artifactId>
			<version>${struts.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-spring-plugin</artifactId>
			<version>${struts.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-junit-plugin</artifactId>
			<version>${struts.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-core</artifactId>
			<version>${struts.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.transaction</groupId>
			<artifactId>jta</artifactId>
			<version>1.1</version>
		</dependency>

		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.2.3-1</version>
		</dependency>

	</dependencies>

</project>