You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thomas Sundberg <ts...@kth.se> on 2011/01/07 23:48:40 UTC
Referens to parent?
Hi!
I'm trying to set up up a multi module project.
My simple approach is this:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>se.sigma</groupId>
<artifactId>aggregation</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>foo</module>
<module>bar</module>
</modules>
</project>
./foo:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>se.sigma</groupId>
<artifactId>aggregation</artifactId>
<version>${project.version}</version>
</parent>
<artifactId>foo</artifactId>
<packaging>jar</packaging>
</project>
./bar:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>se.sigma</groupId>
<artifactId>aggregation</artifactId>
<version>1.0</version>
</parent>
<artifactId>bar</artifactId>
<packaging>jar</packaging>
</project>
Setting up a module like bar works fine. Refering to the parent as I
do i foo fails with the following error:
Non-resolvable parent POM: Failure to find
se.sigma:aggregation:pom:${project.version}
Does anybody have any suggestion on how I can refer to a parent with a
property for the version? The version of the module should be the same
as the version of the parent.
/Thomas
--
Thomas Sundberg
M. Sc. in Computer Science
Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg
Better software through faster feedback
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Referens to parent?
Posted by Anders Hammar <an...@hammar.net>.
You must specify the version of the parent (can't use a property). However,
you don't have to specify the version of the project, it will then use the
version specified for the parent.
/Anders
On Fri, Jan 7, 2011 at 23:48, Thomas Sundberg <ts...@kth.se> wrote:
> Hi!
>
> I'm trying to set up up a multi module project.
>
> My simple approach is this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <groupId>se.sigma</groupId>
> <artifactId>aggregation</artifactId>
> <version>1.0</version>
> <packaging>pom</packaging>
> <modules>
> <module>foo</module>
> <module>bar</module>
> </modules>
> </project>
>
> ./foo:
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>se.sigma</groupId>
> <artifactId>aggregation</artifactId>
> <version>${project.version}</version>
> </parent>
> <artifactId>foo</artifactId>
> <packaging>jar</packaging>
> </project>
>
>
> ./bar:
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>se.sigma</groupId>
> <artifactId>aggregation</artifactId>
> <version>1.0</version>
> </parent>
> <artifactId>bar</artifactId>
> <packaging>jar</packaging>
> </project>
>
> Setting up a module like bar works fine. Refering to the parent as I
> do i foo fails with the following error:
>
> Non-resolvable parent POM: Failure to find
> se.sigma:aggregation:pom:${project.version}
>
> Does anybody have any suggestion on how I can refer to a parent with a
> property for the version? The version of the module should be the same
> as the version of the parent.
>
> /Thomas
>
> --
> Thomas Sundberg
> M. Sc. in Computer Science
>
> Mobile: +46 70 767 33 15
> Blog: http://thomassundberg.wordpress.com/
> Twitter: @thomassundberg
>
> Better software through faster feedback
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>