简体   繁体   中英

Maven - release snapshot dependencies

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM