maven模块不是从父模块构建的

时间:2017-01-25 11:48:31

标签: java maven

集成PMD后,我遇到了maven项目的问题。  我在父母中添加了一个新模块:

 <module>x-build-tools</module>

它也用作插件中的依赖项(在同一个父pom中)

 <build>
 ...
 <plugin>
 ...
  <dependencies>
     <dependency>
         <groupId>com.x.x</groupId>
         <artifactId>x-build-tools</artifactId>
         <version>0.4-SNAPSHOT</version>
      </dependency>
    </dependencies>
  </plugin> 

在模块pom中我有这个:

 <parent>
        <artifactId>x-ms</artifactId>
        <groupId>com.x.x</groupId>
        <version>0.4-SNAPSHOT</version>
    </parent>

    <artifactId>x-build-tools</artifactId>
    <groupId>com.x.x</groupId>
    <modelVersion>4.0.0</modelVersion>
    <version>1.0</version>
    <name>X Build Tools</name>

问题是,如果我构建父项目,我将收到一条错误消息,说它无法在存储库中找到该模块。但是,如果我先构建模块然后再创建父项目,它将起作用。  我已经设法通过从模块中删除父节来解决这个问题并且它有效但我不知道它有多好。

有人可以解释发生了什么吗?

谢谢你, 的Marius

0 个答案:

没有答案
相关问题