springboot打成war包引入本地jar包

1.在本地resource建立lib包

2.pom文件如下配置

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.haiyisoft.uep</groupId>
<artifactId>testWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>testWeb</name>
<url>http://www.haiyisoft.com</url>

<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>

<parent>
<groupId>com.haiyisoft.uep</groupId>
<artifactId>uep-starter-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.haiyisoft.uep</groupId>
<artifactId>uepweb</artifactId>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.zzq</groupId>
<artifactId>fastjson</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/fastjson-1.2.72.jar</systemPath>
</dependency>


</dependencies>

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.meta</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>${project.basedir}/src/main/resources/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>

</plugin>

</plugins>
<finalName>testweb</finalName>
</build>
</project>

posted @ 2020-11-01 12:03  逆水乘舟,不进则退  阅读(482)  评论(0编辑  收藏  举报