Maven子模块不存在 [英] Maven child module does not exist
问题描述
我是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 projectName
it 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-war
just 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屋!