Toasobi
如何引用外部jar包
本文最后更新于2023年09月07日,已超过485天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
pom文件引入
<dependency>
<groupId>com.android</groupId>
<artifactId>AXMLPrinter</artifactId>
<version>2.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/AXMLPrinter-2.0.0.jar</systemPath>
</dependency>
build代码块加条件
<build>
<!-- 打包重命名 -->
<finalName>summit-cloud-web-server</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
<!-- 引入本地jar包 -->
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<!--开启过滤,用指定的参数替换directory下的文件中的参数-->
<filtering>true</filtering>
</resource>
<resource>
<directory>libs</directory>
<targetPath>/BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</build>