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>

 

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