idea 引入外部jar 无法打包到项目里

1. maven引用外部的jar,在pom.xml添加

 1 <dependencies>
 2     <!-- 外部依赖库 -->
 3             <dependency>
 4             <groupId>com.www</groupId>
 5             <artifactId>client</artifactId>
 6             <version>2.8</version>
 7             <scope>system</scope>
 8             <systemPath>${project.basedir}/mylib/client.jar</systemPath>
10         </dependency>
11 </dependencies>

2. 项目打包遇到问题,引入的外部jar一直无法打包到项目jar里面;在网上也查询很多解决办法一直不生效,最终在打包插件中添加配置后问题解决

      <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
         <!-- 添加配置如下--> <configuration> <includeSystemScope>true</includeSystemScope> </configuration>       </plugin>

 

posted @ 2022-05-31 17:44  風巽千龍  阅读(1120)  评论(0)    收藏  举报