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

问题一:

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:
这里写图片描述
util这个模块只是一个普通的maven模块,但是由于父工程引用了springboot的maven插件,所以进行了repackage。

 

 

问题二:

子模块如何引入父模块

 

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

Maven parent.relativePath

默认值为../pom.xml

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

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

<relativePath/>

 

posted on 2020-12-07 17:07  Code2020  阅读(776)  评论(0编辑  收藏  举报