我有三個springboot模塊,不存在父模塊,A參考B模塊,C參考A模塊,idea和eclipse都是可以啟動成功,開發也是沒問題的;
三個模塊的parent都是
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
C模塊的打包插件
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.yun.web.Application</mainClass>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
其它沒有什么特殊配置;
框架相關的組態檔如application.yml、mybaties等都在C模塊;
由于springboot自帶的打包插件spring-boot-maven-plugin打的是可執行的jar,無法被參考;
所以,我把A、B模塊的打包插件換成了普通maven的打包插件maven-compiler-plugin,
C模塊是springbooot打可執行包插件spring-boot-maven-plugin;
先執行B模塊的install安裝到本地倉,再執行A模塊的install安裝到本地倉,再執行C模塊的package,打包成功;
java -jar啟動報錯,錯誤資訊是C模塊下的mybaties配置<typeAliases>,掃描A模塊的包,沒有生效;
個人感覺C模塊的組態檔,沒有對A、B模塊生成的jar生效,但是不知道三個模塊怎么建立關系
uj5u.com熱心網友回復:
不知道,google一下uj5u.com熱心網友回復:
你這個應該在project的根目錄的target里面只生成一個jar包,打開這個jar包,可以看到A和B都在其lib目錄下uj5u.com熱心網友回復:
命令列,mvn package轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/224564.html
標籤:Java相關
上一篇:2020-11-18:java中,到底多大的物件會被直接扔到老年代?
下一篇:java js 機頂盒
