maven 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>zttc.itat.user</groupId>
	<artifactId>user-parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<url>http://maven.apache.org</url>

	<!-- 导入了三个模块,把这三个模块聚合在一起 -->
	<modules>
		<module>../user-core</module>
		<module>../user-log</module>
		<module>../user-service</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
		<jdbc.url>jdbc:mysql://192.168.0.150/cms_test</jdbc.url>
		<jdbc.user>root</jdbc.user>
		<jdbc.password>root</jdbc.password>
		<catalina.home>D:\apache-tomcat-6.0.39</catalina.home>
	</properties>

	<distributionManagement>
		<repository>
			<id>user-release</id>
			<name>user release resp</name>
			<url>http://localhost:8081/nexus/content/repositories/cms-release/</url>
		</repository>
		<snapshotRepository>
			<id>user-snapshots</id>
			<name>user snapshots resp</name>
			<url>http://localhost:8081/nexus/content/repositories/cms-snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

	<!-- 限制访问自己搭建的私服 ,配置自己私服的url,此种方式有局限性,类似局部,需要配置个全局的setting.xml -->
	<!-- setting.xml中配置profile -->
	<!-- <repositories> <repository> <id>nexus</id> <name>nexus Repsository</name> 
		<url>http://localhost:8081/nexus/content/groups/public/</url> 可以下载release版本的jar 
		<releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> 
		默认是false,将其设为true,可以下载snapshots版本的jar <snapshots> <enabled>true</enabled> 
		<updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> -->

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.11</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>mysql</groupId>
				<artifactId>mysql-connector-java</artifactId>
				<version>5.1.31</version>
				<scope>runtime</scope>
			</dependency>

			<dependency>
				<groupId>log4j</groupId>
				<artifactId>log4j</artifactId>
				<version>1.2.17</version>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>javax.servlet-api</artifactId>
				<version>3.1.0</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-core</artifactId>
				<version>4.3.5.Final</version>
			</dependency>

			<dependency>
				<groupId>org.dbunit</groupId>
				<artifactId>dbunit</artifactId>
				<version>2.5.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
				<version>1.1.3</version>
			</dependency>

			<dependency>
				<groupId>org.easymock</groupId>
				<artifactId>easymock</artifactId>
				<version>3.1</version>
				<scope>test</scope>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>

					<groupId>org.mortbay.jetty</groupId>
					<artifactId>jetty-maven-plugin</artifactId>
					<configuration>
						<scanIntervalSeconds>10</scanIntervalSeconds>
						<webApp>
							<contextPath>/hello</contextPath>
						</webApp>
						<connectors>
							<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
								<port>9090</port>
								<maxIdleTime>60000</maxIdleTime>
							</connector>
						</connectors>
					</configuration>

				</plugin>
				<plugin>
					<groupId>com.github.goldin</groupId>
					<artifactId>copy-maven-plugin</artifactId>
					<version>0.2.5</version>
					<executions>
						<execution>
							<id>copy-war</id>
							<phase>package</phase>
							<goals>
								<goal>copy</goal>
							</goals>
							<configuration>
								<resources>
									<!-- ~~~~~~~~~~~~~~ -->
									<!-- Copy resources -->
									<!-- ~~~~~~~~~~~~~~ -->
									<resource>
										<targetPath>${catalina.home}/webapps</targetPath>
										<directory>${project.build.directory}</directory>
										<includes>
											<include>user-web.war</include>
										</includes>
									</resource>
								</resources>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.2.1</version>
					<executions>
						<execution>
							<phase>compile</phase>
							<goals>
								<goal>jar</goal>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</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>
						<!-- 一般不推荐使用,跳过编译,类有错也不能检测 -->
						<!-- <skip>true</skip> -->
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-rar-plugin</artifactId>
					<version>2.3</version>
					<executions>
						<execution>
							<goals>
								<goal>rar</goal>
							</goals>
							<phase>package</phase>
						</execution>
					</executions>

					<configuration>
						<includeJar>true</includeJar>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>sql-maven-plugin</artifactId>
					<version>1.5</version>
					<!-- 使用插件依然可以指定相应的依赖 -->
					<dependencies>
						<dependency>
							<groupId>mysql</groupId>
							<artifactId>mysql-connector-java</artifactId>
							<version>5.1.31</version>
						</dependency>
					</dependencies>
					<configuration>
						<driver>${jdbc.driver}</driver>
						<url>${jdbc.url}</url>
						<username>${jdbc.user}</username>
						<password>${jdbc.password}</password>
					</configuration>

					<executions>
						<execution>
							<id>create-db</id>
							<phase>compile</phase>
							<goals>
								<goal>execute</goal>
							</goals>
							<configuration>
								<sqlCommand>
									CREATE DATABASE IF NOT EXISTS ITAT_MAVEN_TEST
								</sqlCommand>
							</configuration>
						</execution>
						<execution>
							<id>init-table</id>
							<phase>test-compile</phase>
							<goals>
								<goal>execute</goal>
							</goals>
							<configuration>
								<srcFiles>
									<srcFile>src/main/resources/init.sql</srcFile>
								</srcFiles>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<!-- 解决eclipse检验错误 not covered by lifecycle问题 -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<!-- 配置影响检验错误的插件的groupId和artifactId -->
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>sql-maven-plugin</artifactId>
										<!-- 版本 -->
										<versionRange>[1.5,)</versionRange>
										<!-- 目标位goal为execute -->
										<goals>
											<goal>execute</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.17</version>
					<dependencies>
						<dependency>
							<groupId>org.apache.maven.surefire</groupId>
							<artifactId>surefire-junit47</artifactId>
							<version>2.17</version>
						</dependency>
					</dependencies>
					<configuration>
						<!-- 设置包含的测试的类 -->
						<!-- <includes> <include>Test*</include> </includes> -->
						<!-- 不包含的测试类 -->
						<!-- <excludes> <exclude>**/Hello*</exclude> </excludes> 逃过测试类,此时但编译测试类 
							一般不推荐 <skip>true</skip> -->
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>cobertura-maven-plugin</artifactId>
					<version>2.5</version>
					<configuration>
						<formats>
							<format>html</format>
							<format>xml</format>
						</formats>
					</configuration>
					<executions>
						<execution>
							<id>cobertura-report</id>
							<phase>test</phase>
							<goals>
								<goal>
	                				cobertura
	                			</goal>
							</goals>

						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值