Import external jar packages when Maven is packaged
Scenario: Today, when our village flower Sun Dajun writes the project, we need to introduce a jar package written by her colleague. When packaging, this strange jar package could not be entered into the jar (SpringBoot project); although I have been working overtime for 4 or 5 days. Yes, but Dajun’s business is mine. I am still actively helping Dajun solve the problem.
Method 1. Add this jar package to the local warehouse:
这个方法网上很多,但是我做的时候老是失败。。。怎么在仓库里边创建文件夹比较恶心。
Method 2. Add dependency in pom.xml file:
-
<dependency> <groupId>xxx</groupId> <artifactId>xxx</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>${project.basedir}/lib/xxx.jar</systemPath> </dependency> groupId,artifactId,version:这里可以随意定义; systemPath:这里需要你指定jar包所在位置.
2. Focus
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <includeSystemScope>true</includeSystemScope> </configuration> </plugin>
Need to add in Maven's packaging plugin: true