前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >springboot maven项目引入并打包本地JAR

springboot maven项目引入并打包本地JAR

作者头像
路过君
发布2020-09-14 14:20:50
1.1K0
发布2020-09-14 14:20:50
举报
文章被收录于专栏:路过君BLOG from CSDN

之前在 springboot maven项目打包SAPJCO3.JAR一文中介绍的打包方案会导致jar包改名,这里介绍另一种方法。

  • pom.xml
代码语言:javascript
复制
<dependencies>
	<dependency>
	    <groupId>com.sap.conn.jco</groupId>
	    <artifactId>sapjco3</artifactId>
	    <version>3.1.2</version>
	    <scope>system</scope>
	    <systemPath>${basedir}/../lib/sapjco3-3.1.2/sapjco3.jar</systemPath>
    </dependency>
</dependencies>
<build>
	<resources>
		<!-- 加入如下配置,吧jar包以资源形式打包进指定路径 -->	
		<resource>
			<directory>${project.basedir}/../lib</directory>
			<targetPath>BOOT-INF/lib/</targetPath>
			<includes>
				<include>**/*.jar</include>
			</includes>
		</resource>
		<resource>
			<directory>src/main/resources</directory>
			<targetPath>BOOT-INF/classes/</targetPath>
		</resource>
	</resources>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
<!--以下方式打包会导致JAR改名-->
<!--<executions>-->
<!--	<execution>-->
<!--		<goals>-->
<!--			<goal>repackage</goal>-->
<!--		</goals>-->
<!--	</execution>-->
<!--</executions>-->
<!--<configuration>-->
<!--	<includeSystemScope>true</includeSystemScope>-->
<!--</configuration>-->
		</plugin>
	</plugins>
</build>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/09/11 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档