首页 > 解决方案 > maven 多个模块 springbootr:boot 运行错误

问题描述

错误信息:

rc:common:jar:1.0 的 POM 丢失,没有可用的依赖信息

父 pom.xml

<modelVersion>4.0.0</modelVersion>

<groupId>rc</groupId>
<artifactId>springboot-multiple-maven-modules</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
    <module>rest</module>
    <module>common</module>
</modules> 

休息 pom.xml

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>rc</groupId>
    <artifactId>springboot-multiple-maven-modules</artifactId>
    <version>1.0</version>
    <relativePath>../pom.xml</relativePath>
</parent>
<artifactId>rest</artifactId>
<name>zeyo rest</name>
<!--<version>1.0</version>-->
<packaging>jar</packaging>
<dependencies>

    <dependency>
        <groupId>rc</groupId>
        <artifactId>common</artifactId>
        <version>1.0</version>
    </dependency>
   </dependencies>

常见的 pom.xml

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>rc</groupId>
    <artifactId>springboot-multiple-maven-modules</artifactId>
    <version>1.0</version>
    <relativePath>../pom.xml</relativePath>
</parent>
<artifactId>common</artifactId>
<name>common</name>
<version>1.0</version>
<packaging>jar</packaging>

一旦你有了一个名为 rc -> rest -> common 的依赖项。

为什么会这样?

标签: maven

解决方案


这只是说该common项目尚未建成,我们开始了rest

首先在父项目上运行 maven 安装,这样“通用”项目也将被构建。

spring-boot:run : does not build the dependent jars.

希望这可以帮助。


推荐阅读