0

So I currently have 2 projects, lets call them ProjectA, and ProjectB. ProjectA and ProjectB should be released independently of each other. They both use a shared project called ProjectCommon.

<groupId>group</groupId>
<artifactId>ProjectA</artifactId>
<version>0.0.10-SNAPSHOT</version>
<dependencies>
    <dependency>
        <groupId>group</groupId>
        <artifactId>ProjectCommon</artifactId>
        <version>0.0.2-SNAPSHOT</version>
    </dependency>
</dependencies>

Currently If I want to realease ProjectA, I first have to release ProjectCommon, and update the version in ProjectA pom.xml.

Is there a way to automate this? I have been looking at versions:use-latest-releases plugin but I cant get it to work if ProjectCommon is currently using a snapshot. I just get "cant release project due to unreleased dependencies"

Thanks

  • see http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency – Jay Mar 06 '14 at 09:57
  • Thanks for your answer. So the only post relevant, seems to be to use `mvn clean versions:use-latest-versions scm:checkin deploy -Dmessage="update versions" -DperformRelease=true` Is this what you mean? – user3387245 Mar 06 '14 at 12:09
  • Yes that what that post suggests. But in our environments we do it manually to avoid any untested compatibility issues. For example if you automatically upgrade any framework like spring, primefaces, etc some of your existing stable functionality may not work straight away. And if you forget to spot such thing in test phase due to time factor it may end up in production. – Jay Mar 06 '14 at 13:18

1 Answers1

0

You should always use a released version of ProjectCommon in the other projects, that way you have 2 scenarios.

1) You make changes in ProjectCommon and you release it then you update the dependency in ProjectA and ProjectB

2) You make changes in ProjectA and you only release ProjectA

Dan Moldovan
  • 371
  • 3
  • 3
  • Thanks for your answer. So what I really want to know, is it possible to automate scenario 1. – user3387245 Mar 06 '14 at 12:09
  • You can set a dependency to take the last version uploaded, search for LATEST and RELEASE but ProjectA will not auto-release when releasing ProjectCommon. (Also, I'm not recommending using the latest version, it can lead to test problems) – Dan Moldovan Mar 06 '14 at 12:30