4

I have a garden variety Maven project. It has several modules in it. Thus the root pom.xml serves as both parent and aggregator in grand Maven fashion.

This project builds and installs fine.

The root pom.xml inherits from a corporate pom.xml with a stanza like this:

<parent>
  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  <version>16</version> <!-- look, Ma, no SNAPSHOT -->
</parent>

When I run mvn site against this root pom.xml, the maven-site-plugin version 3.2 reports that it cannot resolve the parent.

The parent is of course present in my local repository and in my local Nexus. No other phase of the lifecycle has any trouble resolving the parent.

Others have reported this issue. There is also another StackOverflow question on this subject but it was not immediately apparent that its issue was the exact same as mine.

Adding <relativePath/> to the <parent> stanza above (my first thought) did not alter the behavior in any way.

How can I get the maven-site-plugin to resolve the parent pom.xml?

Community
  • 1
  • 1
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
  • 1
    It appears that this is a known and unresolved issue: http://jira.codehaus.org/browse/MSITE-640. Briefly, the `maven-site-plugin` can only download artifacts from central for some reason, even if you have repositories defined elsewhere. So you either need to set up a mirror so that everything including central goes through a Nexus box somewhere, or you need to hack the `_maven.repositories` file in question in your local repo to remove the repository name. – Laird Nelson Mar 12 '13 at 17:08

3 Answers3

8

This is a bug in the Maven site plugin. The Maven site plugin for various reasons will only ever look for dependencies in what it thinks is Maven central.

Therefore you either have to:

  1. Have a <mirror> element that proxies central through your own Nexus server.
  2. In your local Maven repository, find the parent pom artifact area. Edit its _maven.repositories file so that any mention of the repository name itself is replaced with an empty string.

I chose the latter option. After this the build runs fine.

bish
  • 3,381
  • 9
  • 48
  • 69
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
  • 1
    re: `` -- Specifically you have to set it to your 'public' group so that it can resolve everything. :-/ – docwhat Feb 24 '14 at 16:01
1

Apparently downgrading to 3.3 of the site plugin can also work. :-(

docwhat
  • 11,435
  • 6
  • 55
  • 54
0
  1. File name is _remote.repositories (Maven 3.1.1) Commenting out the lines work as well.
Praveen
  • 71
  • 5