Quantcast

mvn 3: parent.relativePath problem, but no relativePath element

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mvn 3: parent.relativePath problem, but no relativePath element

ljnelson
I have a pom.xml.  It looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>foo-api</artifactId>
  <parent>
    <artifactId>foo-pomtype-api</artifactId>
    <groupId>com.foobar</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <name>Foo API</name>
  <description>Foo API</description>
</project>

Note its parent.  This "pomtype" is a pom.xml that in turn inherits from our
root pom.xml (foo-parent).  So this guy--the foo-api pom you see
above--inherits from a pom (foo-pomtype-api), which inherits from the root (
foo-parent).

When I run mvn install here, I get:

[WARNING] 'parent.relativePath' points at com.foo:foo-parent instead of
com.foo:foo-pomtype-api, please verify your project structure @ line 6,
column 11

Line 6, column 11 is immediately after <parent> above (I removed whitespace
for brevity so the line/column output is wrong here).

I ran find . -name "pom.xml" | xargs grep 'relativePath' from the root, and
there are no relative path elements in any of our pom files.

How do I make this warning go away?

Running Maven 3.0 on Mac OSX.

Best,
Laird
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mvn 3: parent.relativePath problem, but no relativePath element

ljnelson
On Wed, Nov 24, 2010 at 9:09 AM, Laird Nelson <[hidden email]> wrote:

> When I run mvn install here, I get:
>
> [WARNING] 'parent.relativePath' points at com.foo:foo-parent instead of
> com.foo:foo-pomtype-api, please verify your project structure @ line 6,
> column 11
>
> Line 6, column 11 is immediately after <parent> above (I removed
> whitespace for brevity so the line/column output is wrong here).
>
> I ran find . -name "pom.xml" | xargs grep 'relativePath' from the root,
> and there are no relative path elements in any of our pom files.
>

Answering my own question, it looks like I hit
http://jira.codehaus.org/browse/MNG-4687.  Is this fixed in 3.0.1?

L
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mvn 3: parent.relativePath problem, but no relativePath element

Benjamin Bentmann
In reply to this post by ljnelson
Laird Nelson wrote:

> I have a pom.xml.  It looks like this:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <artifactId>foo-api</artifactId>
>    <parent>
>      <artifactId>foo-pomtype-api</artifactId>
>      <groupId>com.foobar</groupId>
>      <version>1.0-SNAPSHOT</version>
>    </parent>
> [...]
> I ran find . -name "pom.xml" | xargs grep 'relativePath' from the root, and
> there are no relative path elements in any of our pom files.

relativePath defaults to the value "../pom.xml" and this value, whether
explicitly given by you or not, is effective for your POM.

So either specify the proper path to your local parent or set
   <relativePath/>
if the parent isn't supposed to be resolved locally.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...