Thank you very much. But what is with the version of the parent project
in the modules pom files? I need to specify the version of the parent:
<parent>
<artifactId>fractionpainter-gui-parent</artifactId>
<groupId>com.deventm.fractionpainter</groupId>
<version>0.1</version>
</parent>
If I don't specify it, I get the error
"Reason: Missing version element from parent element for project
com.deventm.fractionpainter:fractionpainter-gui-config"
I don't like to update the version for the parent in each module's pom
file, is there a solution?
On Sat, 2008-11-29 at 13:59 +1030, Barrie Treloar wrote:
> On Sat, Nov 29, 2008 at 1:15 PM, Erwin Mueller <[EMAIL PROTECTED]> wrote:
> > Hallo,
> > I have a maven2 project with several modules. How can I specify a
> > variable indicating the version for the parent and the modules?
> >
> > Something like that below, so that {$version} is replaced with the
> > project's version. Furthermore, that I need to specify the {$version} in
> > one place only.
>
> Use ${pom.version} but ONLY in the parent pom.
> You use ${pom.version} in the parent dependencyManagement section.
> i.e
> pom.xml:
> ...
> <build>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.deventm.fractionpainter</groupId>
> <artifactId>fractionpainter-core-server</artifactId>
> <version>{$pom.version}</version>
> </dependency>
> <!-- repeat dependency for each module -->
> </dependencies>
> </dependencyManagement>
> ...
>
> Then in the modules you specify the dependencies as normal BUT you do
> not specify a version as that has already been defined in the parent
> dependencyManagement section.
>
> You can also use the <properties> section to define other variables if you
> need.
> <properties>
> <anExambleVariable>withItsValue</anExambleVariable>
> </properties>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]