---- Guillaume Lederrey <[EMAIL PROTECTED]> schrieb:
> On 31/01/2008, amidrunk <[EMAIL PROTECTED]> wrote:
> > Is there any good way to manage versions of dependencies in maven? In maven1
> > it was possible to define the version in a properties file in a root
> > project. Is there something similiar in maven2? Right now we define the
> > versions in settings.xml, but that is not a feasible long-term solution.
> 
> 
> Have a look at dependencyManagement :
> http://maven.apache.org/pom#Dependency_Management

Yep, using dependncyManagement in a parent pom will allow you to then have
> > <dependency>
> >    <groupId>com.mycompany</groupId>
> >    <artifactId>myArtifact</groupId>
> > </dependency>

The alternative is to do this in a parent pom:
<properties>
  <com.mycompany.version>1.1</com.mycompany.version>
</properties>

That will allow you to have:
> > <dependency>
> >    <groupId>com.mycompany</groupId>
> >    <artifactId>myArtifact</groupId>
> >    <version>${com.mycompany.version}</version>
> > </dependency>

Personally, I prefer the second because it is clear to all readers that yes a 
version *is* being specified for this dependency. With the dependencyManagement 
approach, it isn't clear unless you check the parent pom. However I appear to 
be in the minority, with many people preferring dependencyManagement.

Regards, Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to