maven打包為jar文件時,解決scope為system的jar包無法被打包進jar文件的解決方案。


scope為system的maven默認是不打包進去的。

網上查了很多解決方案,基本都是錯誤的,特別是中文社區,基本沒有說到點上的。配置resource的,更容易導致其他問題。

最后,翻到github上的spring-projects/spring-boot的issue里,終於找到了正確的解決之道。

很簡單。

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <includeSystemScope>true</includeSystemScope>
  </configuration>
</plugin>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM