使用spring-boot-maven-plugin
排除指定的包
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<excludeGroupIds>
org.apache.solr
</excludeGroupIds>
</configuration>
</plugin>
这样在打包的时候org.apache.solr
就不会参与打包了。