Maven pom自动添加本地jar文件到本地repository并引用

参考: http://www.it610.com/article/3548222.htm

https://stackoverflow.com/questions/3642023/having-a-3rd-party-jar-included-in-maven-shaded-jar-without-adding-it-to-local-r

首先安装jar文件到本地repository

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<executions>
					<execution>
						<id>install-external</id>
						<phase>clean</phase>
						<configuration>
							<!-- 建行聚合支付,手工安装 -->
							<file>src/main/webapp/WEB-INF/lib/netpay.jar</file>
							<repositoryLayout>default</repositoryLayout>
							<groupId>com.ccb</groupId>
							<artifactId>netpay</artifactId>
							<version>1.0</version>
							<packaging>jar</packaging>
							<generatePom>true</generatePom>
						</configuration>
						<goals>
							<goal>install-file</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

然后引用它:

		<!-- 建行聚合支付 -->
		<dependency>
			<groupId>com.ccb</groupId>
			<artifactId>netpay</artifactId>
			<version>1.0</version>
		</dependency>

猜你喜欢

转载自blog.csdn.net/net_wolf/article/details/90550271