maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Re: Maven with Hibernate/Multiple POM files
Date Wed, 24 Jun 2009 20:15:26 GMT
Hi David,

[sorting the mail]

>> > Another question: I build the base.jar file, and the other two
>> > projects depend upon that file. I've setup the POMs to show this
>> > dependency: Everything builds, but when I run analyze:dependency, it
>> > tells me it is missing base.jar

[snip]

> The "base" directory's POM.xml:
> 
> <project>
>    <modelVersion>4.0.0</modelVersion>
>    <properties>
>            <base.version>2.1.2-SNAPSHOT</base.version>
>    </properties>
>    <groupId>com.solbright</groupId>
>    <version>${base.version}</version>
>    <artifactId>base</artifactId>

[snip]

> The JAR directory pom:
>
> <project>
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.solbright.base</groupId>
>    <artifactId>jar</artifactId>
>    <packaging>jar</packaging>
>    <name>jar</name>
>    <version>${base.version}</version>
>    <parent>
>       <groupId>com.solbright</groupId>
>       <artifactId>base</artifactId>
>           <version>${base.version}</version>
>    </parent>

[snip]

> And, finally the HAR pom.xml
> 
> <project>
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.solbright.base</groupId>
>    <artifactId>har</artifactId>
>    <packaging>har</packaging>
>    <name>har</name>
>    <version>${base.version}</version>
>    <parent>
>       <groupId>com.solbright</groupId>
>       <artifactId>base</artifactId>
>           <version>${base.version}</version>
>    </parent>

[snip]

>         <dependencies>
>                 <dependency>
>                         <groupId>com.solbright.base</groupId>
>                         <artifactId>jar</artifactId>
>                         <version>${base.version}</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.hibernate</groupId>
>                         <artifactId>hibernate</artifactId>
>                         <version>3.1.3</version>
>                 </dependency>
>                 ...
>         </dependencies>
> </project>

1/ A POM is not a programming language, but a project description. It is
pointless to define the properties section in the top of the file in the
hope that Maven sees the values first before you use them. You can
call "mvn help:effective-pom" to see what Maven actually uses for the
project description in the end.

2/ "base.version" is not defined in your submodules if you build from there.
The dependency plugin simply cannot find the parent of your "jar" artifact.

So, stop using properties in the parent section, actually you don't have to
use properties for your versions at all. Use the real version always for
the parent's version and the artifact's version (they're updated by the
release plugin automatically). Define in the parent a depMgmnt section for
the dependencies used by all your modules and declare the dependencies
without version at all.

- Jörg


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


Mime
View raw message