<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--代表maven打包时会将外部引入的jar包-->
<includeSystemScope>true</includeSystemScope>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<!-- 将classpath下自定义的配置文件打入jar包 -->
<directory>src/main/resources/conf</directory>
<targetPath>/conf/</targetPath>
<includes>
<include>**/*.txt</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
pom.xml中引入自定义jar
<dependency>
<groupId>com.wenge</groupId>
<artifactId>KeywordsExtract</artifactId>
<scope>system</scope>
<version>0.1</version>
<systemPath>${project.basedir}/src/main/resources/jar/KeywordsExtract_1.3.jar</systemPath>
</dependency>
maven打包时跳过Test
<properties>
<java.version>1.8</java.version>
<skipTests>true</skipTests>
</properties>
项目结构: