取决于其他本地模块

时间:2017-01-15 14:12:36

标签: java maven intellij-idea repository

我有两个模块,一个链接另一个。当我安装第二个时,构建失败了,说我找不到工件'。这是poms:

    <groupId>xyz.upperlevel.graphicengine</groupId>
    <artifactId>graphicengine</artifactId>
    <packaging>pom</packaging>
    <version>FINAL</version>

    <modules>
        <module>graphicengine-api</module>
        <module>gamelauncher</module>
        <module>testgame</module>
    </modules>

这是主要项目的主力。

然后这里是其中一个模块的pom(都是相同的):

 <parent>
    <groupId>xyz.upperlevel.graphicengine</groupId>
    <artifactId>graphicengine</artifactId>
    <version>FINAL</version>
</parent>

<groupId>xyz.upperlevel.graphicengine.testgame</groupId>
<artifactId>testgame</artifactId>
<version>1.0-SNAPSHOT</version>

我有一个模块A链接到MAIN项目内的模块B.当我构建模块A一切顺利(因为它没有本地模块的依赖)但是当我构建模块B时它失败了。这是错误:

Failed to execute goal on project gamelauncher: Could not resolve dependencies for project xyz.upperlevel.graphicengine.gamelauncher:gamelauncher:jar:1.0-SNAPSHOT: Failed to collect dependencies at xyz.upperlevel.graphicengine.api:graphicengine-api:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for xyz.upperlevel.graphicengine.api:graphicengine-api:jar:1.0-SNAPSHOT: Failure to find xyz.upperlevel.graphicengine:graphicengine:pom:FINAL in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

如何解决?

2 个答案:

答案 0 :(得分:0)

您是否使用了工件的正确坐标? Maven应该自动创建存储库。有关存储库的更多信息,请参阅https://maven.apache.org/guides/introduction/introduction-to-repositories.html。有关工件和依赖项的详细规范,请参阅https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

为了能够以更好的方式为您提供帮助,请提供一些代码。

答案 1 :(得分:0)

我已经解决了:我正在从模块路径建立并从根本项目路径建造建筑物!不要误入我的错误!

相关问题