sbt/sbt-bintray

Modules with publishArtifact:=false should be ignored.

angelcervera opened this issue · 6 comments

Bintray plugin manages modules with publishArtifact:=false as if they were to be published. In that case, Bintray should ignore those modules.

The best example is when you are working in a multimodule project, so:

  • You don't want publish the default artifact because it does not containt anything.
  • You want about modules that are examples of use.

Currently, in both cases, this plugin tries to execute bintrayEnsureBintrayPackageExists, bintrayEnsureLicenses, etc.. when the artifact is not published, there are no licence info, etc.. So the process finish with error.

I created an example:
Tag with the configuration used to proof the possible bug: https://github.com/angelcervera/sbt-multimodule-template/tree/ISSUE1-proofbug
Workaround used: https://github.com/angelcervera/sbt-multimodule-template/tree/feature/ISSUE-1_bintray

Updated work-around (at least for me), in the root module that shouldn't be published:

    publishArtifact := false,
    // Replace tasks to work around https://github.com/sbt/sbt-bintray/issues/93
    bintrayRelease := (),
    bintrayEnsureBintrayPackageExists := (),
    bintrayEnsureLicenses := (),

The preferred flag for this is skip in publish.

Or support both: skip in publish and publishArtifact := false
We used skip in publish.

2m commented

Just checked that skip in publish even if set to true on the root project still checks for the license information on the root project, which should be fixed.

Or support both

As I wrote in sbt/sbt#3136, publishArtifact := false doesn't mean much since it on its own just provides a default value for the more scoped publishArtifact settings. For the sake of consistency with sbt 1 as well as sbt-pgp, we should just stick to skip in publish as the flag to indicate that you want to skip the subproject publishing. I'd be happy to send a PR for this.