maven 拷贝部署

可以将test的配置拷贝到指定目录

maven clean install -Pprod pmd:pmd -Dmaven.test.skip=true
 

 

<build>
	<defaultGoal>package</defaultGoal>
	</build>
	<profiles>
		<profile>
			<id>prod</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>test</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<copy todir="${project.build.outputDirectory}" overwrite="true">
											<fileset dir="${project.build.outputDirectory}/prod" />
										</copy>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

你可能感兴趣的:(maven)