mvn-pom.xml打包配置

<!-- package jar on package -->
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<executions>
		<execution>
			<id>make-a-jar</id>
			<phase>compile</phase>
			<goals>
				<goal>jar</goal>
			</goals>
		</execution>
	</executions>
</plugin>

<!-- install jar to local repository -->
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-install-plugin</artifactId>
	<executions>
		<execution>
			<phase>install</phase>
			<goals>
				<goal>install-file</goal>
			</goals>
			<configuration>
				<packaging>jar</packaging>
				<artifactId>${project.artifactId}</artifactId>
				<groupId>${project.groupId}</groupId>
				<version>${project.version}</version>
				<file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
			</configuration>
		</execution>
	</executions>
</plugin>

<!-- deploy jar to remote repository -->
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-deploy-plugin</artifactId>
	<executions>
		<execution>
			<phase>deploy</phase>
			<goals>
				<goal>deploy-file</goal>
			</goals>
			<configuration>
				<packaging>jar</packaging>
				<generatePom>true</generatePom>
				<url>${project.distributionManagement.repository.url}</url>
				<artifactId>${project.artifactId}</artifactId>
				<groupId>${project.groupId}</groupId>
				<version>${project.version}</version>
				<file>${project.build.directory}/${project.artifactId}.jar</file>
			</configuration>
		</execution>
	</executions>
</plugin>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章