You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Carsten Karkola <ck...@mms-dresden.de> on 2006/05/18 13:17:02 UTC

Maven 2.0.4 - Cascading POMs with packaging=pom

Hi,

I've created the following directory layout

 /a - pom.xml
   /b - pom.xml
       - /b.a -pom.xml

My executions:
  $> cd ~/a
  $> mvn compile
  [INFO] BUILD SUCCESSFUL

  $> cd ~/a/b/b.a
  $> mvn compile
  [INFO] BUILD SUCCESSFUL

  $> cd ~/a/b
  $> mvn compile
  [INFO] Scanning for projects...
  Downloading: http://.../repository/com/foo/a/I/a-I.pom
  [WARNING] Unable to get resource from repository central
  [INFO] ------------------------------------------------------------------------
  [ERROR] FATAL ERROR
  [INFO] ------------------------------------------------------------------------
  [INFO] Failed to resolve artifact.

  GroupId: com.foo
  ArtifactId: a
  Version: I

I've looked at the effective poms with mvn help:effective-pom, the poms in directory a and in 
directory b.a are ok., the creation of the pom in b fails. It seems that there is a problem with 
more than one parent with packaging=pom.

The only workearound (suggested in the maven user mailing list) is, to deploy the parent 
poms to the maven repo, but this way you can't do a standalone compile or package if you 
have changed the parent pom.

regards, carsten

The poms - a/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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>
  <groupId>com.foo</groupId>
  <artifactId>a</artifactId>
  <version>I</version>
  <name>Module A</name>
  <packaging>pom</packaging>

  <modules>
   <module>b</module>
  </modules>

</project>

The poms - a/b/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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">

  <parent>
    <groupId>com.foo</groupId>
    <artifactId>a</artifactId>
    <version>I</version>
  </parent>
 
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.foo</groupId>
  <artifactId>b</artifactId>
  <version>I</version>
  <name>Module B</name>
  <packaging>pom</packaging>
 
  <modules>
    <module>b.a</module>
  </modules>

</project>

The poms - a/b/b.a/pom.xml:
-------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<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">

  <parent>
    <groupId>com.foo</groupId>
    <artifactId>b</artifactId>
    <version>I</version>
  </parent>
 
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.foo</groupId>
  <artifactId>b.a</artifactId>
  <version>I</version>
  <name>Module B.A</name>
  <packaging>jar</packaging>
 
</project>

------- End of forwarded message -------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Carsten Karkola <ck...@mms-dresden.de>.
Thank you for your hint, Marcel. But the <relativePath> entry didn't help, 
Maven tries to look up the pom in the repo:

Reason: Unable to download the artifact from any repository

  com.foo:a:pom:I

regards, carsten

On 18 May 2006 at 13:25, Marcel May wrote:

> Try the in the suprojects "/project/parent/relativePath" setting ...
> seems that takes precendence over repository resolution when building.
> 
> Example for b:
> <parent>
>   <relativePath>../pom.xml</relativePath>
> </parent>
> 
> Does this help?
> 
> Cheers,
> Marcel
> 
> Carsten Karkola wrote:
> > Hi,
> >
> > I've created the following directory layout
> >
> >  /a - pom.xml
> >    /b - pom.xml
> >        - /b.a -pom.xml
> >
> > My executions:
> >   $> cd ~/a
> >   $> mvn compile
> >   [INFO] BUILD SUCCESSFUL
> >
> >   $> cd ~/a/b/b.a
> >   $> mvn compile
> >   [INFO] BUILD SUCCESSFUL
> >
> >   $> cd ~/a/b
> >   $> mvn compile
> >   [INFO] Scanning for projects...
> >   Downloading: http://.../repository/com/foo/a/I/a-I.pom
> >   [WARNING] Unable to get resource from repository central
> >   [INFO] ------------------------------------------------------------------------
> >   [ERROR] FATAL ERROR
> >   [INFO] ------------------------------------------------------------------------
> >   [INFO] Failed to resolve artifact.
> >
> >   GroupId: com.foo
> >   ArtifactId: a
> >   Version: I
> >
> > I've looked at the effective poms with mvn help:effective-pom, the poms in directory a and in 
> > directory b.a are ok., the creation of the pom in b fails. It seems that there is a problem with 
> > more than one parent with packaging=pom.
> >
> > The only workearound (suggested in the maven user mailing list) is, to deploy the parent 
> > poms to the maven repo, but this way you can't do a standalone compile or package if you 
> > have changed the parent pom.
> >
> > regards, carsten
> >
> > The poms - a/pom.xml:
> > -------------------------------------------
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <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>
> >   <groupId>com.foo</groupId>
> >   <artifactId>a</artifactId>
> >   <version>I</version>
> >   <name>Module A</name>
> >   <packaging>pom</packaging>
> >
> >   <modules>
> >    <module>b</module>
> >   </modules>
> >
> > </project>
> >
> > The poms - a/b/pom.xml:
> > -------------------------------------------
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <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">
> >
> >   <parent>
> >     <groupId>com.foo</groupId>
> >     <artifactId>a</artifactId>
> >     <version>I</version>
> >   </parent>
> >  
> >   <modelVersion>4.0.0</modelVersion>
> >   <groupId>com.foo</groupId>
> >   <artifactId>b</artifactId>
> >   <version>I</version>
> >   <name>Module B</name>
> >   <packaging>pom</packaging>
> >  
> >   <modules>
> >     <module>b.a</module>
> >   </modules>
> >
> > </project>
> >
> > The poms - a/b/b.a/pom.xml:
> > -------------------------------------------
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <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">
> >
> >   <parent>
> >     <groupId>com.foo</groupId>
> >     <artifactId>b</artifactId>
> >     <version>I</version>
> >   </parent>
> >  
> >   <modelVersion>4.0.0</modelVersion>
> >   <groupId>com.foo</groupId>
> >   <artifactId>b.a</artifactId>
> >   <version>I</version>
> >   <name>Module B.A</name>
> >   <packaging>jar</packaging>
> >  
> > </project>
> >
> > ------- End of forwarded message -------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >   
> 
> 
> -- 
> Marcel May
> ConSol* Software GmbH
> Tel: +49 89 45841-155
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Carsten Karkola <ck...@mms-dresden.de>.
But if I do the compile in a/b/b.a it works w/o install.
I think it should work - my use case is:
large structure with a lot of projects - I modify something in a subproject, add 
something to the profile in the top project - and I cant do a compile/package 
in the subproject for testing - and I can't do an install in the top project 
because one of my subprojects fails. (I have to migrate from ant to Maven 2 
...)
My workaround is, to make the changes, put the parent pom via copy in the 
repo and so I can use the new profile variables in my subprojects, but my 
hope was, that the poms get resolved in subdir a/b as they get resolved in 
subdir a/b/b.a

regards, carsten

On 18 May 2006 at 13:37, Trygve Laugstøl wrote:

> Carsten Karkola wrote:
> > Hi,
> > 
> > I've created the following directory layout
> > 
> >  /a - pom.xml
> >    /b - pom.xml
> >        - /b.a -pom.xml
> > 
> > My executions:
> >   $> cd ~/a
> >   $> mvn compile
> >   [INFO] BUILD SUCCESSFUL
> 
> You have to do 'mvn install' to install the pom into the repository. If 
> not Maven doesn't have any places to find the parent pom.
> 
> --
> Trygve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Carsten Karkola <ck...@mms-dresden.de>.
On 19 May 2006 at 11:30, Grzegorz Slowikowski wrote:

> Yes, you can.
> 
> Greg

There is the BUG-ID: http://jira.codehaus.org/browse/MNG-2308
regards, carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Grzegorz Slowikowski <gs...@op.pl>.
Yes, you can.

Greg

----- Original Message ----- 
From: "Carsten Karkola" <ck...@mms-dresden.de>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Friday, May 19, 2006 10:24 AM
Subject: Re: Maven 2.0.4 - Cascading POMs with packaging=pom


> Hello,
> thank you for verifying!
> Can I create an JIRA issue or who is responsible for this?
> regards, carsten
> 
>> >
>> Hello
>> 
>> Maven should look for parent pom in parent directory first.
>> This have been described some time ago by Brett (I think).
>> 
>> I have just tested it. It's a regression in Maven 2.0.4.
>> I tested on Maven 2.0.2, 2.03 and 2.0.4. Only 2.0.4 does
>> not work.
>> 
>> Can someone create Jira issue?
>> 
>> Greetings
>> 
>> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.6.1/343 - Release Date: 2006-05-18
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Carsten Karkola <ck...@mms-dresden.de>.
Hello,
thank you for verifying!
Can I create an JIRA issue or who is responsible for this?
regards, carsten

> >
> Hello
> 
> Maven should look for parent pom in parent directory first.
> This have been described some time ago by Brett (I think).
> 
> I have just tested it. It's a regression in Maven 2.0.4.
> I tested on Maven 2.0.2, 2.03 and 2.0.4. Only 2.0.4 does
> not work.
> 
> Can someone create Jira issue?
> 
> Greetings
> 
> Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Grzegorz Slowikowski <gs...@op.pl>.
----- Original Message ----- 
From: "Trygve Laugstøl" <tr...@codehaus.org>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Thursday, May 18, 2006 1:37 PM
Subject: Re: Maven 2.0.4 - Cascading POMs with packaging=pom


> Carsten Karkola wrote:
>> Hi,
>>
>> I've created the following directory layout
>>
>>  /a - pom.xml
>>    /b - pom.xml
>>        - /b.a -pom.xml
>>
>> My executions:
>>   $> cd ~/a
>>   $> mvn compile
>>   [INFO] BUILD SUCCESSFUL
>
> You have to do 'mvn install' to install the pom into the repository. If 
> not Maven doesn't have any places to find the parent pom.
>
> --
> Trygve
>
Hello

Maven should look for parent pom in parent directory first.
This have been described some time ago by Brett (I think).

I have just tested it. It's a regression in Maven 2.0.4.
I tested on Maven 2.0.2, 2.03 and 2.0.4. Only 2.0.4 does
not work.

Can someone create Jira issue?

Greetings

Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Trygve Laugstøl <tr...@codehaus.org>.
Carsten Karkola wrote:
> Hi,
> 
> I've created the following directory layout
> 
>  /a - pom.xml
>    /b - pom.xml
>        - /b.a -pom.xml
> 
> My executions:
>   $> cd ~/a
>   $> mvn compile
>   [INFO] BUILD SUCCESSFUL

You have to do 'mvn install' to install the pom into the repository. If 
not Maven doesn't have any places to find the parent pom.

--
Trygve

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2.0.4 - Cascading POMs with packaging=pom

Posted by Marcel May <ma...@consol.de>.
Try the in the suprojects "/project/parent/relativePath" setting ...
seems that takes precendence over repository resolution when building.

Example for b:
<parent>
  <relativePath>../pom.xml</relativePath>
</parent>

Does this help?

Cheers,
Marcel

Carsten Karkola wrote:
> Hi,
>
> I've created the following directory layout
>
>  /a - pom.xml
>    /b - pom.xml
>        - /b.a -pom.xml
>
> My executions:
>   $> cd ~/a
>   $> mvn compile
>   [INFO] BUILD SUCCESSFUL
>
>   $> cd ~/a/b/b.a
>   $> mvn compile
>   [INFO] BUILD SUCCESSFUL
>
>   $> cd ~/a/b
>   $> mvn compile
>   [INFO] Scanning for projects...
>   Downloading: http://.../repository/com/foo/a/I/a-I.pom
>   [WARNING] Unable to get resource from repository central
>   [INFO] ------------------------------------------------------------------------
>   [ERROR] FATAL ERROR
>   [INFO] ------------------------------------------------------------------------
>   [INFO] Failed to resolve artifact.
>
>   GroupId: com.foo
>   ArtifactId: a
>   Version: I
>
> I've looked at the effective poms with mvn help:effective-pom, the poms in directory a and in 
> directory b.a are ok., the creation of the pom in b fails. It seems that there is a problem with 
> more than one parent with packaging=pom.
>
> The only workearound (suggested in the maven user mailing list) is, to deploy the parent 
> poms to the maven repo, but this way you can't do a standalone compile or package if you 
> have changed the parent pom.
>
> regards, carsten
>
> The poms - a/pom.xml:
> -------------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <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>
>   <groupId>com.foo</groupId>
>   <artifactId>a</artifactId>
>   <version>I</version>
>   <name>Module A</name>
>   <packaging>pom</packaging>
>
>   <modules>
>    <module>b</module>
>   </modules>
>
> </project>
>
> The poms - a/b/pom.xml:
> -------------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <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">
>
>   <parent>
>     <groupId>com.foo</groupId>
>     <artifactId>a</artifactId>
>     <version>I</version>
>   </parent>
>  
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.foo</groupId>
>   <artifactId>b</artifactId>
>   <version>I</version>
>   <name>Module B</name>
>   <packaging>pom</packaging>
>  
>   <modules>
>     <module>b.a</module>
>   </modules>
>
> </project>
>
> The poms - a/b/b.a/pom.xml:
> -------------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <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">
>
>   <parent>
>     <groupId>com.foo</groupId>
>     <artifactId>b</artifactId>
>     <version>I</version>
>   </parent>
>  
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.foo</groupId>
>   <artifactId>b.a</artifactId>
>   <version>I</version>
>   <name>Module B.A</name>
>   <packaging>jar</packaging>
>  
> </project>
>
> ------- End of forwarded message -------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>   


-- 
Marcel May
ConSol* Software GmbH
Tel: +49 89 45841-155


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org