Hi Todd,
Todd Thiessen wrote at Donnerstag, 5. März 2009 16:21:
>
>> > Getting back to the issue at hand though, what is the proper way in
>> > Maven to do a build with the release plugin when you have
>> dependencies
>> > between modules? Are you supposed to do something with the
>> dependency
>> > plugin to ensure that dependencies get properly resolved during the
>> > prepare?
>>
>> Use the proper version strings for all artifacts that are
>> part of the multi-project, not properties, and let the
>> release plugin handle this.
>
> Perhaps you are referring to something I am not familiar with but I am
> doing all that. All module projects have the proper version. In this
> case ${project.version}.
>
> However, when you have dependencies between modules, the release prepare
> will fail by default since it doesn't do an install. Without an install,
> one module doesn't have access to the artifacts of another.
Exactly, therefore you should not use ${project.version} at all, because
during release the value is simply wrong. However, in this case release
plugin cannot adjust the value, because it is "hiding".
Working approach is:
Parent POM:
===========
...
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
...
<dependencyManagement>
<dependencies>
<dependency>
<groupId>group</groupId>
<artifactId>childA</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>group</groupId>
<artifactId>childB</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
ChildA POM:
===========
<parent>
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>childA</artifactId>
...
ChildB POM:
===========
<parent>
<groupId>group</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>childB</artifactId>
...
<dependencies>
<dependency>
<groupId>group</groupId>
<artifactId>childA</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
All those version strings will automatically adjusted.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]