这个真的困扰了我好几天,今天终于试验OK了。

首先需要在pom里面添加本地模块的依赖

    <dependencies>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>module_one</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
</dependencies>

这里添加之后,还是不行的,还需要再添加模块依赖,如下图:

Springboot之添加本地模块依赖_spring

 Springboot之添加本地模块依赖_springboot_02

**********************!!!!!!!!!!!!必须两个一起添加!!!!!!!!!!!

添加任何一个都不行,都会失败。

之后就OK了。