views:

371

answers:

3

Hi,

I am using Maven2. I have created a parent POM for my organization. I want the various groups will use it as a parent for their project but I want them to use the latest version. for some reason, using it as a parent with version LATEST doesn't work,

any idea?

Thanks, Ronen.

A: 

I think you want to use SNAPSHOT, e.g.

<version>1.2-SNAPSHOT</version>
Robert Munteanu
+5  A: 

You don't need to define a new version for every small change you make in the POM.

The version means specific features of an artifact (in a POM are build settings), what I'd do is to declare one version and make all the projects use that version (to use a SNAPSHOT version is a great idea). If you make a small update do it in that version. If you make a bigger change you might want to declare a new version and have all the new POMs to use that version, this way you'll avoid to break old projects by using a new super POM.

victor hugo
Yup, SNAPSHOT is the way to go. When you deploy a POM with a version tag with SNAPSHOT in it, the keyword will be replaced by a timestamp. Your users will automatically download the version with the latest timestamp to their local repos as a result.
mikek
A: 

Did you try something like this?

  <parent>
      <groupId>com.foo</groupId>
      <artifactId>foo-super-pom</artifactId>
      <version>[1.0.0,2.0.0)</version>
  </parent>

This should select the latest between version 1 and version 1.9.9.9...

Never used it for a parent, but it works for dependencies.

sal