jvican / sbt-release-early

Opinionated sbt plugin to release your artifacts early, both on merge and via git tag.
Mozilla Public License 2.0
92 stars 9 forks source link

Duplicated releases on sonatype for aggregated projects #30

Open Atry opened 5 years ago

Atry commented 5 years ago

I have an sbt build, which contains a root project, which aggregates many other projects. I configured all those projects, including the root project, for publishing on sonatype.

When I run the shell command sbt releaseEarly, the task releaseEarly is executed on all those projects because of aggregation. For each project, the task releaseEarly internally execute the command ;publishSigned;sonatypeRelease due to https://github.com/scalacenter/sbt-release-early/blob/9e50b77073120fac3bf37707d394e1db638bdb9f/src/main/scala/ch/epfl/scala/sbt/release/ReleaseEarlyPlugin.scala#L266

Unfortunately the command ;publishSigned;sonatypeRelease triggers aggregated projects, again. As a result, those aggregated projects are published twice, and sonatype reports an error message:

Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/com/thoughtworks/sbt-best-practice/git_2.12_1.0/4.1.0+9-5a67fa32/git-4.1.0+9-5a67fa32-sources.jar'

The complete error log can be found at https://travis-ci.org/ThoughtWorksInc/sbt-best-practice/builds/505041539

Atry commented 5 years ago

The bug occurs because the execution of commands. Can we use triggeredBy instead of commands as suggested in https://github.com/scalacenter/sbt-release-early/wiki/Essential:-Installation#advantages-over-sbt-release in order to fix this bug?