Cannot find parent pom, but it IS there

1,163 views
Skip to first unread message

Chad....@emc.com

unread,
Aug 3, 2012, 2:10:46 PM8/3/12
to jenkins...@googlegroups.com

I’m on an older Hudson server.  One of my projects can’t find it’s parent pom, though other ones can.  Doesn’t seem like a nexus side issue since the other projects are finding it okay.  I have the –U flag turned on to prevent caching of a failure response.  I can’t figure anything out.  

 

What can be causing this?

Russ Tremain

unread,
Aug 3, 2012, 2:21:35 PM8/3/12
to Chad....@emc.com, jenkins...@googlegroups.com
this is more of a maven question, I think.

Try turning -X on in the maven job to find out where it is looking.

At 2:10 PM -0400 8/3/12, <Chad....@emc.com> wrote:
>I'm on an older Hudson server. One of my projects can't find it's parent pom, though other ones can. Doesn't seem like a nexus side issue since the other projects are finding it okay. I have the -U flag turned on to prevent caching of a failure response. I can't figure anything out.

Chad....@emc.com

unread,
Aug 6, 2012, 5:49:56 PM8/6/12
to jenkins...@googlegroups.com
> this is more of a maven question, I think.
>
> Try turning -X on in the maven job to find out where it is looking.
>

Thanks. I've already done that though. The output is below. Note, the remote repository where it claims to be looking does indeed hold the artifact. Moreover, other projects on the same build server can access it there.

It may very well be a maven problem, but how do I fix it. I'm using a private maven repository for the build, as are the others that can successfully retrieve the artifact. From what I understand, I would suspect a maven caching issue, but the -U is supposed to resolve that, as far as I know.


ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Cannot find parent: com.my.group:project-pom for project: com.my.group.service.common:common:pom:1.1.0-SNAPSHOT for project com.my.group.service.common:common:pom:1.1.0-SNAPSHOT
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:215)
at hudson.maven.MavenEmbedder.readProject(MavenEmbedder.java:332)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:871)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:794)
at hudson.FilePath.act(FilePath.java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:534)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:420)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
at hudson.model.Run.run(Run.java:1257)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:306)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:127)
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.my.group:project-pom' not found in repository: Unable to download the artifact from any repository

com.my.group:project-pom:pom:1.1.0-SNAPSHOT

from the specified remote repositories:
nexus (http://myNexus.com:8081/nexus/content/groups/public)
for project com.my.group:project-pom
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:603)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 15 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

com.my.group:project-pom:pom:1.1.0-SNAPSHOT

from the specified remote repositories:
nexus (http://myNexus.com:8081/nexus/content/groups/public)

at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:556)
... 16 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 18 more
Email was triggered for: Failure

Nomar Morado

unread,
Aug 6, 2012, 6:28:38 PM8/6/12
to jenkins...@googlegroups.com, jenkins...@googlegroups.com
What is your directory structure? That is where is your parent Pom relative to your child project

Printing e-mails wastes valuable natural resources. Please don't print this message unless it is absolutely necessary. Thank you for thinking green!

Sent from my iPhone

Russ Tremain

unread,
Aug 6, 2012, 5:09:45 PM8/6/12
to Chad....@emc.com, jenkins...@googlegroups.com
well probably what I would do is eliminate jenkins from the mix entirely.

create a tiny pom that references the parent.

then run it on the same machine that jenkins is running on.

does it work?

if so diff it against the pom that is not working.

is it the same?

hard to believe it is a jenkins issue, but I generally avoid the direct execution route for maven - I wrap a shell script around it.

sometimes the parent references can be tricky. the name and version elements have to agree exactly.

I usually am referencing these poms with a relative path .. and I don't use snapshots for them. as an example:


<?xml version="1.0" encoding="UTF-8"?>
<project>
<parent>
<artifactId>build-common-dao</artifactId>
<groupId>com.iii</groupId>
<version>640.0.0</version>
<relativePath>../../../../build-common/dao</relativePath>
</parent>

I have had instances where the path is correct but the name is wrong, and then it balks.

If you are worried about maven updating to snapshots, remove the artifact in your local build repository (~/.m2/repository is the default) and force it to load again.

good luck!

/r

Jeff

unread,
Aug 6, 2012, 11:16:09 PM8/6/12
to jenkins...@googlegroups.com, Chad....@emc.com

The parent POM need not be in the path at all...if the relative path is not specified and there is no parent POM in the immediate parent (../) folder, maven will download it just like any other dependency.  The parent version also need not be related to the child project version at all.

I currently treat my Parent POM as a separate project and version/release it independently from my 25 other projects.

Vincent Latombe

unread,
Aug 8, 2012, 8:01:19 AM8/8/12
to jenkins...@googlegroups.com
In old versions of Jenkins/Hudson, the -U flag is not used for the POM parsing step (although it is used for the build step) leading to inconsistencies depending on the state of your local repository.

This was fixed in Jenkins 1.461.

In any case, possible workarounds are :
- switch to freestyle job (no parsing involved *before* the build)
- empty local repository

Vincent


2012/8/7 Jeff <preda...@gmail.com>

Davis, Chad

unread,
Aug 8, 2012, 10:32:32 AM8/8/12
to jenkins...@googlegroups.com


> What is your directory structure? That is where is your parent Pom relative to
> your child project
>

My parent pom is not in a hierarchical directory structure. This is not a requirement, is it? It should resolve from my nexus repository though. And it does from my local build, just not in Hudson.

Davis, Chad

unread,
Aug 8, 2012, 10:47:00 AM8/8/12
to jenkins...@googlegroups.com

> In old versions of Jenkins/Hudson, the -U flag is not used for the POM parsing step (although it is used for the build step) leading to inconsistencies depending on the state of > your local repository.
>

My projects use a private repository, if that matters. Isn't there anyway to set this to be cleaned for each build? IT seems like it would be a necessity . . .

Davis, Chad

unread,
Aug 29, 2012, 3:39:11 PM8/29/12
to jenkins...@googlegroups.com
I'm having this problem again. I have a new version of a parent pom, a snapshot version if that matters. It is in Nexus, and from my local command line environment, the parent pom is resolved when I build the child. When the child builds in Hudson, it can't find the parent pom during the parsing phase . . .

Earlier on this thread someone suggested clearing the repository, since the -U doesn't work during the Hudson parsing phase . . . my project is configured to use a private repository , but I don't see any way of clearing that repository. How would I do that?
Reply all
Reply to author
Forward
0 new messages