一段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>

	<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>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
		<jdbc.url>jdbc:mysql://localhost:3306</jdbc.url>
		<jdbc.username>root</jdbc.username>
		<jdbc.password>123456</jdbc.password>
		<catalina.home>D:\apache-tomcat-6.0.33-windows-x86</catalina.home>
	</properties>

	<!-- <repositories> <repository> <id>nexus</id> <name>Nexus Repository</name> 
		<url>http://localhost:8081/nexus/content/groups/public/</url> <releases> 
		<enabled>true</enabled> </releases> snapshots默认是关闭的,需要手动开启 <snapshots> <enabled>true</enabled> 
		</snapshots> </repository> </repositories> -->

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.10</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-core</artifactId>
				<version>4.1.10.Final</version>
			</dependency>
			<dependency>
				<groupId>mysql</groupId>
				<artifactId>mysql-connector-java</artifactId>
				<version>5.1.24</version>
				<scope>runtime</scope>
			</dependency>
			<dependency>
				<groupId>log4j</groupId>
				<artifactId>log4j</artifactId>
				<version>1.2.17</version>
			</dependency>
			<dependency>
				<groupId>dbunit</groupId>
				<artifactId>dbunit</artifactId>
				<version>2.2</version>
			</dependency>
			<dependency>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
				<version>1.1.1</version>
			</dependency>
			<dependency>
				<groupId>org.easymock</groupId>
				<artifactId>easymock</artifactId>
				<version>3.1</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>servlet-api</artifactId>
				<version>2.5.20110712</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>user-core</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>user-service</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>user-log</artifactId>
				<version>${project.version}</version>
				<exclusions>
					<!-- 可以排除依赖 -->
					<exclusion>
						<groupId>commons-logging</groupId>
						<artifactId>commons-logging</artifactId>
					</exclusion>
				</exclusions>
			</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>8787</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>
									<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.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>sql-maven-plugin</artifactId>
										<versionRange>[1.5,)</versionRange>
										<goals>
											<goal>execute</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</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.24</version>
						</dependency>
					</dependencies>
					<configuration>
						<driver>${jdbc.driver}</driver>
						<url>${jdbc.url}</url>
						<username>${jdbc.username}</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>
				<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>cobertura-maven-plugin</artifactId>
					<configuration>
						<formats>
							<format>html</format>
							<format>xml</format>
						</formats>
					</configuration>
					<executions>
						<execution>
							<id>cobertura-report</id>
							<goals>
								<goal>cobertura</goal>
							</goals>
							<phase>test</phase>
						</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>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
				  <!-- 指定jdk编译版本 -->
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.0</version>
					<configuration>
						<source>1.6</source>
						<target>1.6</target>
						<!-- 此处设置了skip等于设置了把所有的测试编译都跳过,如果测试类写得有问题,也不会报错,所以一般不使用 -->
						<!-- <skip>true</skip> -->
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.14</version>
					<configuration>
						<!-- 设置包含的测试类 -->
						<!-- <includes> <include>**/Hello*</include> </includes> -->
						<!-- 设置不进行测试的类 <excludes> <exclude>Test*</exclude> </excludes> -->
						<!-- 跳过测试阶段,一般不推荐跳过 -->
						<!-- <skip>true</skip> -->
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值