问题一:

springboot 多个maven模块打包异常:Unable to find main class
原因:在父工程中加入了springboot的maven插件,即:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

此插件会进行repackage:
开发遇到的问题:springboot问题:Unable to find main class
util这个模块只是一个普通的maven模块,但是由于父工程引用了springboot的maven插件,所以进行了repackage。

 

 

问题二:

子模块如何引入父模块

开发遇到的问题:springboot问题:Unable to find main class

 

 出现不去本地进行找包,直接去私服中找包。

默认值为../pom.xml

查找顺序:relativePath元素中的地址–本地仓库–远程仓库

设定一个空值将始终从仓库中获取,不从本地路径获取。

<relativePath/>

 

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-03-31
  • 2021-06-07
  • 2021-09-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-08-16
  • 2021-10-19
相关资源
相似解决方案