Did you know about maven version ranges for your dependencies?

Your application pom may define dependency on a specific version of a jar file. For example your project may depend on Facebook API wrapper version 2.0.4

<dependency>
  <groupId>org.facebook4j</groupId>
  <artifactId>facebook4j-core</artifactId>
  <version>2.0.4</version>
</dependency>

If your code satisfies the API sice 2.0, you can mark the compatible version range and maven will use the latest version in the range, so you are not stuck with the old version.

<dependency>
  <groupId>org.facebook4j</groupId>
  <artifactId>facebook4j-core</artifactId>
  <version>[2.0,)</version>
</dependency>

More: http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRangesWith this you can ease the upgrade process of your project, however your tests must always ensure that the compatibility is well tested.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: