MavenError: Failed to execute goal on project: Could not resolve dependencies In Maven Multimodule project

后端 未结 4 1627
太阳男子
太阳男子 2020-12-29 22:16

I am trying to create a maven multi-module project. the project is created successfully but when I am trying to use one module as a dependency of another module, it throws a

相关标签:
4条回答
  • 2020-12-29 22:21

    In case anybody comes back to this, I think the problem here was failing to install the parent pom first, which all these submodules depend on, so the Maven Reactor can't collect the necessary dependencies to build the submodule.

    So from the root directory (here D:\luna_workspace\empire_club\empirecl) it probably just needs a:

    mvn clean install
    

    (Aside: <relativePath>../pom.xml</relativePath> is not really necessary as it's the default value).

    0 讨论(0)
  • 2020-12-29 22:25

    My solution:

    1. remove all projects in current workspace
    2. import all again
    3. maven update project (Alt + F5) -> Select All and check Force Update of Snapshots/Releases
    4. maven build (Ctrl + B) until there is nothing to build

    It worked for me after the second try.

    0 讨论(0)
  • 2020-12-29 22:37

    My solution was to insert <packaging>pom</packaging> between artifactId and version

    <groupId>com.onlinechat</groupId>
    <artifactId>chat-online</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <modules>
        <module>server</module>
        <module>client</module>
        <module>network</module>
    </modules>
    
    0 讨论(0)
  • 2020-12-29 22:47

    In my case I forgot it was packaging conflict jar vs pom. I forgot to write

    <packaging>pom</packaging>
    

    In every child pom.xml file

    0 讨论(0)
提交回复
热议问题