通用工具模塊不必要完整的打包,而是只需要在打包的時候保留自己編寫的代碼
- 添加依賴
<dependency> <!-- generate jar without third part jars --> <groupId>org.springframework.boot.experimental</groupId> <artifactId>spring-boot-thin-layout</artifactId> <version>1.0.23.RELEASE</version> </dependency>
- 添加插件配置
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <dependency> <!-- generate jar without third part jars --> <groupId>org.springframework.boot.experimental</groupId> <artifactId>spring-boot-thin-layout</artifactId> <version>1.0.23.RELEASE</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin>
重新打包后就會發現所有的依賴jar包都不存在了