0

On my team we have a common module (project C) used by 2 other projects:

Project A --> Project C

Project B --> Project C

We are all using maven 3. There is also a Artifactory server available to us.

I really don't want the hassle of updating Project A and B poms everytime there is an update to project C. I just want the latest version.

At the same time, I don't want to have to keep updating the pom for project C everytime there is a change there.

Is this possible?

FinalFive
  • 1,465
  • 2
  • 18
  • 33
  • If you don't update the pom for project C, how would other projects that depend on project C understand that there has been a change? But yes, unfortunately, it is possible. – Nikola Yovchev Dec 18 '13 at 13:24
  • 1
    If the modules are all under development then you can use [SNAPSHOTS](http://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html#pom-relationships-sect-snapshot-versions). This answer should help: http://stackoverflow.com/a/5907727/1570834. – DB5 Dec 18 '13 at 13:25
  • baba - we use continuous integration. The idea is when project C is changed, project A and B will automatically build, taking in the new Project C, and run all tests. – FinalFive Dec 18 '13 at 15:41

1 Answers1

0

For the first part, you can take a look at this: How do I tell Maven to use the latest version of a dependency?

Basically, you can configure A and B to rely on latest version of C. For C, you can configure a hook in git or some other thing, to update the version of C automatically each time there is a change in it. See:

http://maven.apache.org/maven-release/maven-release-plugin/

Community
  • 1
  • 1
Nikola Yovchev
  • 9,498
  • 4
  • 46
  • 72
  • I'm reluctant to use the maven release plugin as it seems complicated to setup. If setting project C to 1.0-SNAPSHOT permanently is an option and have project A and B configured to always look for a newer version, that would be better. Any issues? – FinalFive Dec 18 '13 at 16:10