Maven子模块不存在 [英] Maven child module does not exist

查看:96
本文介绍了Maven子模块不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Maven的新手.我从SVN签出了一个具有以下结构的客户项目:

I'm new to Maven. I checked out from SVN a project from a customer with the following structure:

projectName
|--> pom.xml
|--> jetty-wrapper
     |--> pom.xml
     |--> bin
          |--> pom.xml
|--> projectName-common
     |--> pom.xml
     |--> bin
          |--> pom.xml
|--> projectName-war
     |--> bin
          |--> pom.xml

"projectName"(顶部的pom)正下方的pom.xml正在构建三个模块

the pom.xml right below 'projectName` (the pom at the top) is building the three modules

<modules>
    <module>projectName-common</module>
    <module>projectName-war</module>
    <module>jetty-wrapper</module>
</modules>

但是从文件夹projectName执行mvn clean install时,会出现以下错误

But when executing mvn clean install from folder projectNameit gives the following error

Child module [...]projectName\projectName-war\pom.xml of [...]projectName\pom.xml does not exist

问题是:projectName-war下方是否应该有pom.xml,就像我的客户可能忘记使用SVN的其余模块一样?

The question is: Should there be a pom.xml right below projectName-warjust like with the rest of the modules that my customer may have forgotten to commit to SVN?

推荐答案

问题是:在projectName-war下面应该有pom.xml

The question is: Should there be a pom.xml right below projectName-war

只需即可.

您已经找到了窍门,并且由于尚未向maven提供项目描述符(也称为 pom.xml ),因此无法调用 projectName-war 有效的子模块.

You have already figured out the trick, and since you haven't provided a project descriptor aka pom.xml to maven, it won't be able to call the projectName-war a valid child module.

projectName-war 下必须绝对有一个 pom.xml 文件,并且它必须具有与声明模块的父对象下的工件ID相匹配的工件ID,即

There must absolutely be a pom.xml file under projectName-war, and it must have an artifact id that matches the one under the parent declaring the module, i.e.

<artifactId>projectName-war</artifactId>

这篇关于Maven子模块不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆