You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Moser <ma...@qfs.de> on 2007/01/03 15:58:19 UTC

problem compiling a sub-project of a project

Hi all,

I have troubles compiling my sub-projects.

I have following project-structure:

-base-project
	--sub-project 1
		--- subsub-project 1 of sub-project 1
		--- subsub-project 2 of sub-project 1
	-- sub-project 2
		--- subsubproject 1 of sub-project 2

	
I want to compile sub-project 1 only. So I changed to the sub-project1 
directory and called "mvn compile".

But maven tries to download the pom of the base-project and this fails, as 
this pom is in no repository yet.
The build of the base-project or the jar-build of subsub-project1 works 
fine.

Did I miss anything to configure?


My pom.xml's look like that:

pom.xml of base-project:
	<groupId>testgroup</groupId>
  	<artifactId>base</artifactId>
	<packaging>pom</packaging>
	<version>1.99.1</version>
		:
	<modules>
        	<module>sub1</module>
		<module>sub2</module>
	</modules>


pom.xml of sub-project 1 in subfolder sub1:
	<groupId>testgroup</groupId>
  	<artifactId>sub1</artifactId>
	<packaging>pom</packaging>
	<version>1.99.1</version>
		:

	<parent>
		<groupId>testgroup</groupId>
		<artifactId>base</artifactId>
		<version>1.99.1</version>
		<relativePath>..</relativePath>
	</parent>

	<modules>
		:




I appreciate any suggestions!
Thanks in advance!

Regards,
Martin

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


RE: problem compiling a sub-project of a project

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
Hi Martin

I currently use my own patched Version of Maven 2.0.x Snapshot
as I did some property resolution workaround (as mentioned in my 
other post).

I have a test setup with a base project and one module.
for testing I always delete my own artefacts in my local maven repo,
then I use mvn install on the module level.
Everything works fine, the module artefact will be deployed, but my
module
is a jar and not a pom, maybe there is a problem over there...

- Daniel

> -----Original Message-----
> From: Martin Moser [mailto:martin@qfs.de] 
> Sent: Wednesday, January 03, 2007 5:09 PM
> To: Maven Users List
> Subject: Re: problem compiling a sub-project of a project
> 
> Hi all,
> 
> thanks for your fast response.
> 
> @Roman
> My sub-project inherits some dependency and plugin defintions 
> from the 
> base-project, so I can't omit the <parent> tag.
> So I think that I have to compile the base-project all the 
> time. That's 
> fine with me. I was just curious, whether it's possible or 
> not as I am 
> playing around with Maven a little bit.
> 
> @Daniel
> Removing the <relativePath> worked, but it still tries to 
> download the 
> parent. Anyway, thank you for this hint as it makes the pom.xml more 
> readable!
> 
> Regards,
> Martin
> 
> --On Mittwoch, Januar 03, 2007 16:48:33 +0100 Roman Kalukiewicz 
> <ro...@gmail.com> wrote:
> 
> > Your sub-project1 references base-project as it's parrent. 
> This means it
> > has
> > to inherit all configuration from base-project so it has to 
> be downloaded.
> >
> > If your sub-project1 does not inherit anyting from base, then omit
> > <parrent>
> > tag.
> >
> > It is perfectly legal to have multimodule project where sub-projects
> > doesn't
> > reference base-project as parents.
> >
> > 2007/1/3, Martin Moser <ma...@qfs.de>:
> >>
> >> Hi all,
> >>
> >> I have troubles compiling my sub-projects.
> >>
> >> I have following project-structure:
> >>
> >> -base-project
> >>         --sub-project 1
> >>                 --- subsub-project 1 of sub-project 1
> >>                 --- subsub-project 2 of sub-project 1
> >>         -- sub-project 2
> >>                 --- subsubproject 1 of sub-project 2
> >>
> >>
> >> I want to compile sub-project 1 only. So I changed to the 
> sub-project1
> >> directory and called "mvn compile".
> >>
> >> But maven tries to download the pom of the base-project 
> and this fails,
> >> as this pom is in no repository yet.
> >> The build of the base-project or the jar-build of 
> subsub-project1 works
> >> fine.
> >>
> >> Did I miss anything to configure?
> >>
> >>
> >> My pom.xml's look like that:
> >>
> >> pom.xml of base-project:
> >>         <groupId>testgroup</groupId>
> >>         <artifactId>base</artifactId>
> >>         <packaging>pom</packaging>
> >>         <version>1.99.1</version>
> >>                 :
> >>         <modules>
> >>                 <module>sub1</module>
> >>                 <module>sub2</module>
> >>         </modules>
> >>
> >>
> >> pom.xml of sub-project 1 in subfolder sub1:
> >>         <groupId>testgroup</groupId>
> >>         <artifactId>sub1</artifactId>
> >>         <packaging>pom</packaging>
> >>         <version>1.99.1</version>
> >>                 :
> >>
> >>         <parent>
> >>                 <groupId>testgroup</groupId>
> >>                 <artifactId>base</artifactId>
> >>                 <version>1.99.1</version>
> >>                 <relativePath>..</relativePath>
> >>         </parent>
> >>
> >>         <modules>
> >>                 :
> >>
> >>
> >>
> >>
> >> I appreciate any suggestions!
> >> Thanks in advance!
> >>
> >> Regards,
> >> Martin
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > Roman Kalukiewicz
> --
> Martin Moser                                  Martin@qfs.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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


Re: problem compiling a sub-project of a project

Posted by Martin Moser <ma...@qfs.de>.
Hi all,

thanks for your fast response.

@Roman
My sub-project inherits some dependency and plugin defintions from the 
base-project, so I can't omit the <parent> tag.
So I think that I have to compile the base-project all the time. That's 
fine with me. I was just curious, whether it's possible or not as I am 
playing around with Maven a little bit.

@Daniel
Removing the <relativePath> worked, but it still tries to download the 
parent. Anyway, thank you for this hint as it makes the pom.xml more 
readable!

Regards,
Martin

--On Mittwoch, Januar 03, 2007 16:48:33 +0100 Roman Kalukiewicz 
<ro...@gmail.com> wrote:

> Your sub-project1 references base-project as it's parrent. This means it
> has
> to inherit all configuration from base-project so it has to be downloaded.
>
> If your sub-project1 does not inherit anyting from base, then omit
> <parrent>
> tag.
>
> It is perfectly legal to have multimodule project where sub-projects
> doesn't
> reference base-project as parents.
>
> 2007/1/3, Martin Moser <ma...@qfs.de>:
>>
>> Hi all,
>>
>> I have troubles compiling my sub-projects.
>>
>> I have following project-structure:
>>
>> -base-project
>>         --sub-project 1
>>                 --- subsub-project 1 of sub-project 1
>>                 --- subsub-project 2 of sub-project 1
>>         -- sub-project 2
>>                 --- subsubproject 1 of sub-project 2
>>
>>
>> I want to compile sub-project 1 only. So I changed to the sub-project1
>> directory and called "mvn compile".
>>
>> But maven tries to download the pom of the base-project and this fails,
>> as this pom is in no repository yet.
>> The build of the base-project or the jar-build of subsub-project1 works
>> fine.
>>
>> Did I miss anything to configure?
>>
>>
>> My pom.xml's look like that:
>>
>> pom.xml of base-project:
>>         <groupId>testgroup</groupId>
>>         <artifactId>base</artifactId>
>>         <packaging>pom</packaging>
>>         <version>1.99.1</version>
>>                 :
>>         <modules>
>>                 <module>sub1</module>
>>                 <module>sub2</module>
>>         </modules>
>>
>>
>> pom.xml of sub-project 1 in subfolder sub1:
>>         <groupId>testgroup</groupId>
>>         <artifactId>sub1</artifactId>
>>         <packaging>pom</packaging>
>>         <version>1.99.1</version>
>>                 :
>>
>>         <parent>
>>                 <groupId>testgroup</groupId>
>>                 <artifactId>base</artifactId>
>>                 <version>1.99.1</version>
>>                 <relativePath>..</relativePath>
>>         </parent>
>>
>>         <modules>
>>                 :
>>
>>
>>
>>
>> I appreciate any suggestions!
>> Thanks in advance!
>>
>> Regards,
>> Martin
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Roman Kalukiewicz
--
Martin Moser                                  Martin@qfs.de

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


Re: problem compiling a sub-project of a project

Posted by Roman Kalukiewicz <ro...@gmail.com>.
Your sub-project1 references base-project as it's parrent. This means it has
to inherit all configuration from base-project so it has to be downloaded.

If your sub-project1 does not inherit anyting from base, then omit <parrent>
tag.

It is perfectly legal to have multimodule project where sub-projects doesn't
reference base-project as parents.

2007/1/3, Martin Moser <ma...@qfs.de>:
>
> Hi all,
>
> I have troubles compiling my sub-projects.
>
> I have following project-structure:
>
> -base-project
>         --sub-project 1
>                 --- subsub-project 1 of sub-project 1
>                 --- subsub-project 2 of sub-project 1
>         -- sub-project 2
>                 --- subsubproject 1 of sub-project 2
>
>
> I want to compile sub-project 1 only. So I changed to the sub-project1
> directory and called "mvn compile".
>
> But maven tries to download the pom of the base-project and this fails, as
> this pom is in no repository yet.
> The build of the base-project or the jar-build of subsub-project1 works
> fine.
>
> Did I miss anything to configure?
>
>
> My pom.xml's look like that:
>
> pom.xml of base-project:
>         <groupId>testgroup</groupId>
>         <artifactId>base</artifactId>
>         <packaging>pom</packaging>
>         <version>1.99.1</version>
>                 :
>         <modules>
>                 <module>sub1</module>
>                 <module>sub2</module>
>         </modules>
>
>
> pom.xml of sub-project 1 in subfolder sub1:
>         <groupId>testgroup</groupId>
>         <artifactId>sub1</artifactId>
>         <packaging>pom</packaging>
>         <version>1.99.1</version>
>                 :
>
>         <parent>
>                 <groupId>testgroup</groupId>
>                 <artifactId>base</artifactId>
>                 <version>1.99.1</version>
>                 <relativePath>..</relativePath>
>         </parent>
>
>         <modules>
>                 :
>
>
>
>
> I appreciate any suggestions!
> Thanks in advance!
>
> Regards,
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Roman Kalukiewicz

RE: problem compiling a sub-project of a project

Posted by "Mohni, Daniel" <da...@ch.unisys.com>.
Hello Martin

you can omit relative path if the base is one level
higher as this is the default value when the parent
is generated.

But you always can use 

<relativePath>../pom.xml</relativePath>

Maybe your problem is that you use only

<relativePath>..</relativePath>

as you don't use any properties this should work with
stable maven 2.0.4

- Daniel


> -----Original Message-----
> From: Martin Moser [mailto:martin@qfs.de] 
> Sent: Wednesday, January 03, 2007 3:58 PM
> To: users@maven.apache.org
> Subject: problem compiling a sub-project of a project
> 
> Hi all,
> 
> I have troubles compiling my sub-projects.
> 
> I have following project-structure:
> 
> -base-project
> 	--sub-project 1
> 		--- subsub-project 1 of sub-project 1
> 		--- subsub-project 2 of sub-project 1
> 	-- sub-project 2
> 		--- subsubproject 1 of sub-project 2
> 
> 	
> I want to compile sub-project 1 only. So I changed to the 
> sub-project1 
> directory and called "mvn compile".
> 
> But maven tries to download the pom of the base-project and 
> this fails, as 
> this pom is in no repository yet.
> The build of the base-project or the jar-build of 
> subsub-project1 works 
> fine.
> 
> Did I miss anything to configure?
> 
> 
> My pom.xml's look like that:
> 
> pom.xml of base-project:
> 	<groupId>testgroup</groupId>
>   	<artifactId>base</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.99.1</version>
> 		:
> 	<modules>
>         	<module>sub1</module>
> 		<module>sub2</module>
> 	</modules>
> 
> 
> pom.xml of sub-project 1 in subfolder sub1:
> 	<groupId>testgroup</groupId>
>   	<artifactId>sub1</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.99.1</version>
> 		:
> 
> 	<parent>
> 		<groupId>testgroup</groupId>
> 		<artifactId>base</artifactId>
> 		<version>1.99.1</version>
> 		<relativePath>..</relativePath>
> 	</parent>
> 
> 	<modules>
> 		:
> 
> 
> 
> 
> I appreciate any suggestions!
> Thanks in advance!
> 
> Regards,
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

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