Skip to content

Conversation

mpollmeier
Copy link
Contributor

Even with publishArtifact := false the user is still forced to define a (dummy) resolver that's never used, e.g. publishTo := { Some("publishMeNot" at "https://publish/me/not") }

Otherwise the following error is thrown:

publish
[error] java.lang.RuntimeException: Repository for publishing is not specified.
[error]         at scala.sys.package$.error(package.scala:27)
[error]         at sbt.Classpaths$.$anonfun$getPublishTo$1(Defaults.scala:2436)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at sbt.Classpaths$.getPublishTo(Defaults.scala:2436)
[error]         at sbt.Classpaths$.$anonfun$ivyBaseSettings$48(Defaults.scala:1917)

Is 1.0.x the right target branch, or should it rather be 1.x?

@eed3si9n eed3si9n added the ready label Nov 22, 2017
@dwijnand
Copy link
Member

I think this is a good change. Could you add a test for this use case so we don't regress, please? Either to an existing scripted test or a new one.

Given this isn't (as far as I understand) a regression in behaviour since sbt 0.13, I think it's safer merge this in 1.x, so it participates in a release candidate phase.

@2m
Copy link
Member

2m commented Nov 23, 2017

FWIW If skip in publish := true is used to disable the pubishing, then no publishTo needs to be defined.

@mpollmeier mpollmeier force-pushed the mpollmeier/resolver-not-needed-if-not-publishing branch from d63b2f1 to 991c71d Compare November 23, 2017 21:08
@mpollmeier mpollmeier changed the base branch from 1.0.x to 1.x November 23, 2017 21:09
@mpollmeier
Copy link
Contributor Author

mpollmeier commented Nov 23, 2017

  • rebased onto 1.x and changed the target branch
  • added a test (and tested that it fails prior to this patch, becomes green with the patch)

@mpollmeier mpollmeier force-pushed the mpollmeier/resolver-not-needed-if-not-publishing branch from 348b0d3 to 93b18b6 Compare November 27, 2017 00:00
@mpollmeier
Copy link
Contributor Author

the travis errors look like flukes. @dwijnand anything else stopping this to get merged?

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restarted the failed Travis CI jobs. This LGTM, pending Travis CI.

@mpollmeier
Copy link
Contributor Author

green enough @dwijnand ?

@dwijnand dwijnand added this to the 1.2.0 milestone Dec 15, 2017
Even with `publishArtifact := false` the user is still forced to define a (dummy) resolver that's never used, e.g. `publishTo := { Some("publishMeNot" at "https://publish/me/not") }`

Otherwise the following error is thrown:
```
publish
[error] java.lang.RuntimeException: Repository for publishing is not specified.
[error]         at scala.sys.package$.error(package.scala:27)
[error]         at sbt.Classpaths$.$anonfun$getPublishTo$1(Defaults.scala:2436)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at sbt.Classpaths$.getPublishTo(Defaults.scala:2436)
[error]         at sbt.Classpaths$.$anonfun$ivyBaseSettings$48(Defaults.scala:1917)
```
@dwijnand dwijnand force-pushed the mpollmeier/resolver-not-needed-if-not-publishing branch from 82b2b9e to 4668faf Compare December 15, 2017 10:55
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay @mpollmeier. Yes.

I added notes as well (and rebased).

@dwijnand dwijnand self-assigned this Dec 15, 2017
@dwijnand dwijnand merged commit fd8b422 into sbt:1.x Dec 21, 2017
@dwijnand dwijnand removed the ready label Dec 21, 2017
@mpollmeier mpollmeier deleted the mpollmeier/resolver-not-needed-if-not-publishing branch December 22, 2017 03:23
mpollmeier added a commit to mpollmeier/gremlin-scala that referenced this pull request Dec 22, 2017
@dwijnand dwijnand removed their assignment Jan 9, 2018
@eed3si9n
Copy link
Member

eed3si9n commented Aug 6, 2019

I actually don't understand the steps, problem, and the expectation of this PR.
As discussed in #3136 and noted by @2m, the right flag to toggle the behavior is publish / skip, not publishArtifact, which is meaningless when it's unscoped.

@eed3si9n
Copy link
Member

eed3si9n commented Aug 6, 2019

The description says:

publish
[error] java.lang.RuntimeException: Repository for publishing is not specified.
[error]         at scala.sys.package$.error(package.scala:27)
[error]         at sbt.Classpaths$.$anonfun$getPublishTo$1(Defaults.scala:2436)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at sbt.Classpaths$.getPublishTo(Defaults.scala:2436)
[error]         at sbt.Classpaths$.$anonfun$ivyBaseSettings$48(Defaults.scala:1917)

so if I reverse engineer the steps would it be:

steps

  1. don't specify publishTo, but set publishArtifact to false.
  2. run publish.

problem

[error] java.lang.RuntimeException: Repository for publishing is not specified.
[error]         at scala.sys.package$.error(package.scala:27)
[error]         at sbt.Classpaths$.$anonfun$getPublishTo$1(Defaults.scala:2436)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at sbt.Classpaths$.getPublishTo(Defaults.scala:2436)
[error]         at sbt.Classpaths$.$anonfun$ivyBaseSettings$48(Defaults.scala:1917)

expectation

no errors.

Would that be right?

@mpollmeier
Copy link
Contributor Author

Your 'reverse engineer' of the problem from back then is correct, and as you said, if publish/skip is the setting we should actually use, that works for me. Feel free to revert this, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants