File->Peoject->Springboot lnitializr
选择项目存放目录Finish
放入你要引入的第三方jar并且选中jar右键Add ad library
groupId,artifactId,version可随便写 systemPath路径一定要指定全路径
<dependency>
<groupId>com.qrcodegroupId>
<artifactId>qrcodeartifactId>
<version>1.8version>
<scope>systemscope>
<systemPath>${project.basedir}/src/main/resources/lib/QRCode.jarsystemPath>
dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<configuration>
<includeSystemScope>trueincludeSystemScope>
configuration>
plugin>
plugins>
build>
@RestController
public class QrcodeTest {
@RequestMapping("/code")
public void qrcodeTest(){
//这个就是刚引入的jar
Qrcode qrcode = new Qrcode();
System.out.println(qrcode);
}
}
结果:输出jar对象地址
命令:mvn clean && mvn compile && mvn package && start target
命令:mvn clean && mvn compile && mvn package && start target