IDEA編譯報錯“程式包XXX不存在”
阿新 • • 發佈:2018-12-12
pchat-center子模塊要匯入 pchat-user 的jar包
pchat-center的pom檔案如下:
pchat-center子模組包依賴了pchat-user子模組包
程式碼如下:
程式碼沒顯示任務異常,沒有標紅顯示。
maven編譯結果如下:
明明引入了pchat-user包,而且顯示成功引入了,maven本地庫也有這個jar包
錯誤原因是pchat-user打包方式不對。
spring-boot maven打包,一般pom.xml檔案裡會加
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
這樣打的jar裡會多一個目錄BOOT-INF。(反編譯工具開啟)
2.引起問題,程式包不存在。
3.解決辦法,如果A子模組包依賴了B子模組包,在B子模組的pom檔案,加入
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
目錄BOOT-INF沒有了