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 <predato...@gmail.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. > On Aug 6, 2012 8:22 PM, "Russ Tremain" <ru...@releasetools.org> wrote: > >> 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 >> >> >> >> At 3:11 PM -0400 8/3/12, <chad.da...@emc.com> wrote: >> > > 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 >> >