正常情况下,scope=system的包是不会打进包中的。
<dependency>
<groupId>com.netflix.feign</groupId>
<artifactId>feign-jackson</artifactId>
<version>8.18.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/feign-jackson-8.18.0.jar</systemPath>
</dependency>
此时如果需要将jar包打输出到lib中,需添加配includeSystemScope=true
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<mainClass>com.startboot.StartApplication</mainClass>
</configuration>
</plugin>
如果你需要打到war包中,此时并不会将本地jar包打入\WEB-INF\lib 下,而是在 \WEB-INF\lib-provided 下,所以需要添加以下插件配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/lib/</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>