Comments (21)
@alexflav23 Thanks. I got the pain point. sbt plugin should be used safely without such a conditional switch.
from sbt-sonatype.
Thanks for the feedback. I didn't notice that the global plugins (e.g., specified in ~/.sbt/0.13/plugins/...) have higher precedence than the project settings. Is it true?
If so, we should let sbt-sonatype users manually set publishTo
.
from sbt-sonatype.
seems to be the case. @eed3si9n?
Setting manually seems safer.
from sbt-sonatype.
If you're using the auto plugin correctly, and not doing the Project(..., settings = ...)
, the user-defined settings should be ordered after the auto plugin's settings.
from sbt-sonatype.
@eed3si9n correctly on the side of the plugin author or user? I as the user just added it via addPlugin to my global plugins.sbt, nothing else, so I suppose it must be on the plugins side.
Also if I have a multi project built, one sub-project configured to deploy to bintray and nothing configure for the others, would a publish on the root project deploy my other sub-projects to sonatype then? Sounds not ideal. @xerial how about making publishTo a manual opt-in?
from sbt-sonatype.
It looks like a newly added code in sbt-sonatype 1.1, which updates publishTo
, might be causing the problem: https://github.com/xerial/sbt-sonatype/blob/master/src/main/scala/xerial/sbt/Sonatype.scala#L124.
@cvogt
Does the same problem happen if you use sbt-sonatype 1.0?
from sbt-sonatype.
@xerial I was actually using 0.5.1, but confirmed the same problem also exists with 1.0 and 1.1.
from sbt-sonatype.
@cvogt On the side of the build user. Does your build look like this?
val foo = project.settings(publishTo := Some(x))
and Some(x)
is taken over by the setting from a plugin?
from sbt-sonatype.
It looks like this. Is there a different recommended way to propagate the setting to all sub projects?
object MyBuild extends Build {
override lazy val settings =
super.settings ++
Seq(
publishTo := {
Some( ... )
},
...
)
}
from sbt-sonatype.
It seems the use of lazy for the settings causes the unintentional overwrite.
from sbt-sonatype.
@cvogt I cannot reproduce this issue:
$ cat build.sbt
publishTo := Some("repo" at "http://some.repo.org")
$ sbt "show publishTo" [9:19:30 Apr 04 2016]
[info] Loading global plugins from /Users/leo/.sbt/0.13/plugins
[info] Set current project to sonatype-test (in build file:/Users/leo/work/git/tmp/sonatype-test/)
[info] Some(repo: http://some.repo.org)
$ cat build.sbt
// publishTo := Some("repo" at "http://some.repo.org")
$ sbt "show publishTo" [9:20:51 Apr 04 2016]
[info] Loading global plugins from /Users/leo/.sbt/0.13/plugins
[info] Set current project to sonatype-test (in build file:/Users/leo/work/git/tmp/sonatype-test/)
[info] Some(sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots)
from sbt-sonatype.
It looks like this. Is there a different recommended way to propagate the setting to all sub projects?
Make an one-off auto plugin inside project/*.scala
. http://www.scala-sbt.org/0.13/docs/Organizing-Build.html#Defining+auto+plugins
from sbt-sonatype.
Here's an example: https://github.com/sbt/sbt-pgp/blob/v1.0.0/project/Common.scala
from sbt-sonatype.
+1 On this, it's still a problem as of the latest release. I cannot add the plugin without having it override all bintray publishing settings for instance.
from sbt-sonatype.
@alexflav23 Does it mean you need to have both sonatype and bintray repositories for publishing? If so I agree with that having pre-defined publishTo is cumbersome.
from sbt-sonatype.
Hi @xerial,
No, it means simply including sbt-sonatype
as an SBT plugin will override any other publishTo
setting found in the project, so we need to work around it.
For example here, where we toggle an environment variable in the CI server which prevents the build from loading the plugin in the first place, just so we can publish to bintray.
Regards.
from sbt-sonatype.
sbt-sonatype do not set publishTo by default since 2.0.0-M1 (for sbt-1.0.0-M5)
from sbt-sonatype.
Nice :)!!! Any chance we can get it for sbt 0.13?
from sbt-sonatype.
Now working on cross building sbt plugins.
from sbt-sonatype.
Uploaded sbt-sonatype 2.0.0-M1 for sbt 0.13.x
https://oss.sonatype.org/content/repositories/releases/org/xerial/sbt/sbt-sonatype_2.10_0.13/2.0.0-M1/
from sbt-sonatype.
awesome, thx so much!
from sbt-sonatype.
Related Issues (20)
- Unexpected exeption when publishing crossbuild with Scala 3.x artifacts HOT 5
- sonatypeRelease error with worng nexus URL HOT 4
- Can not set sonatypeProfileName HOT 5
- error [Sonatype] [MISSING_PROFILE] Profile winitzki is not found. Check your sonatypeProfileName setting in build.sbt - (Sonatype.scala:425) HOT 4
- Supplied file is a not an existing directory! HOT 3
- Determining Sonatype host on a per-user level, rather than build/project-level? HOT 2
- Promotion Success / Process Failed HOT 19
- [STAGE_FAILURE] Failed to promote the repository HOT 2
- Unable to publish sbt plugin to sonatype due to missing javadoc HOT 1
- NullPointerException "anyController" is null HOT 4
- Need a retry for 502 errors around bundle upload
- Drop requests fail occasionally with 404 HOT 1
- sonatypePublishToBundle not found HOT 12
- wvlet.airframe.http.HttpClientException HOT 13
- SnatypeClient logs not forwarded to sbt client HOT 6
- java.lang.NoClassDefFoundError: wvlet/airframe/rx/RxStream HOT 1
- Publish to Maven Central with new interface HOT 12
- Redirect error on publishSigned HOT 7
- 401 Content access is protected by token HOT 4
- Missing method (java.nio.file.Path.of) when using SonatypeCentralService on Java 8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-sonatype.