springboot使用本地Jar包
springboot使用本地Jar包
·
方式一:将jar包安装到maven本地仓库
命令
mvn install:install-file -DgroupId=com.tongweb -DartifactId=tongweb-embed -Dversion=7.0.E.4_P2 -Dfile=/E:/myProject/EexcelDownloadTest/src/main/resources/lib/tongweb-embed-7.0.E.4_P2.jar -Dpackaging=jar
参数解析:
- Dfile:插件包的位置
- DgroupId:插件在maven仓库目录标识
- DartifactId:插件在maven仓库唯一标识
- Dversion:插件版本号
- Dpackaging:插件包类型
- DgeneratePom=true 生成
.pom文件
方式二:直接引入本地jar包
<dependency>
<groupId>com.tongweb</groupId>
<artifactId>tongweb-embed</artifactId>
<version>7.0.E.4_P2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/tongweb-embed-7.0.E.4_P2.jar</systemPath>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--本地包导入配置-->
<includeSystemScope>true</includeSystemScope>
<!--自定义分类器配置,防止父子项目打包失败-->
<classifier>exec</classifier>
</configuration>
</plugin>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)