可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have my maven project setup as 1 shell projects and 4 children modules. When I try to build the shell. I get:
[INFO] Scanning for projects... [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project module1:1.0_A0 (C:\module1\pom.xml) has 1 error [ERROR] Non-resolvable parent POM: Failure to find shell:pom:1.0_A0 in http://nyhub1.ny.ssmb.com:8081/nexus/content/repositories/JBoss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
If I try to build a lone module I get the same error only replace module1, with whatever module it was.
Have them all referencing the parent in their poms.
shellconverter1.0_A0
Here is the relevant parts of the shell pom:
convertershell1.0_A0pomshellmodule1module2module3module4
回答1:
Just for reference.
The joys of Maven.
Putting the relative path of the modules to ../pom.xml solved it.
The parent
element has a relativePath
element that you need to point to the directory of the parent. It defaults to ..
回答2:
It can also be fixed by putting the correct settings.xml
file into the ~/.m2/
directory.
回答3:
Alternative reason also might be the parent artifact comes from repository which is not accessible from pom.xml
, typically private repository. The solution was to provide that repository in pom.xml
:
internal-repointernal repositoryhttps://my/private/repodefaulttruetrue
In my case the problem was even more complicated due to Eclipse: the repository was active only in special profile (activate-private-repo...
) and Maven GUI in Eclipse didn't allow to set this profile through Ctrl+Alt+P
shortcut.
The solution was to temporarily declare repository outside profile (unconditionally), launch Alt+F5
Maven Update Project, activate profile and put repository declaration back into profile. This is rather Eclipse bug, not Maven bug.
回答4:
verify if You have correct values in child POMs
GroupId ArtefactId Version
In Eclipse, for example, You can search for it: 
回答5:
Replace 1.0_A0 with ${project.version}
Run mvn once. This will download all the required repositories. You may switch back to 1.0_A0 after this step.
回答6:
I had similar problem at my work.
Building the parent project without dependency created parent_project.pom file in the .m2 folder.
Then add the child module in the parent POM and run Maven build.
module1module2module3module4
回答7:
I had the issue that two reactor build pom.xml files had the same artefactId.