Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of the extra resolver #21

Closed
jvican opened this issue Oct 18, 2017 · 15 comments · Fixed by #22
Closed

Get rid of the extra resolver #21

jvican opened this issue Oct 18, 2017 · 15 comments · Fixed by #22

Comments

@jvican
Copy link
Contributor

jvican commented Oct 18, 2017

I see that you release to Bintray instead of Sonatype. I think it would be better to release directly to Sonatype so that I don't have to add yet another resolver to my build 😄.

You could also use sbt-release-early -> https://github.com/scalacenter/sbt-release-early.

@jvican
Copy link
Contributor Author

jvican commented Oct 18, 2017

I would consider this an important issue, because it forces plugins that depend on this one to tell their users to add the resolver too. I'm in the process of adding sbt-github-release to the sbt-platform plugin that will be used by all Scala Platform modules, and I've just realised that.

@laughedelic
Copy link
Contributor

Hi @jvican! This issue is not related to publishing to Bintray or Sonatype. It's an issue with the underlying Github library: hub4j/github-api#195. That's one of the reasons I want to migrate to another library (most likely 47deg/github4s): #17.

Regarding Bintray publishing: the repo is linked to the community repo sbt-plugin-releases, so if the problem mentioned above was solved, you wouldn't need to add any resolvers, sbt-plugin-releases is included in the default plugin resolver chain. So I don't see any point in changing to Sonatype.

You could also use sbt-release-early -> scalacenter/sbt-release-early.

We're using our own release pipeline here, so I think currently it's not an option.

I would consider this an important issue, because it forces plugins that depend on this one to tell their users to add the resolver too.

I totally agree. It sucks ☹️ Again, I really want to do #17 (which shouldn't be too hard as there's not much code in general).

I'm in the process of adding sbt-github-release to the sbt-platform plugin that will be used by all Scala Platform, and I've just realised that.

Sounds awesome! 👍 I'll be glad to help with it.

@jvican
Copy link
Contributor Author

jvican commented Oct 19, 2017

Oh, I see, now it makes sense 👍!

So, it seems that #17 would take you some time. Have you considered releasing github-api with your organization to Maven Central? It sounds like that would be a time-saving way of fixing this problem.

@laughedelic
Copy link
Contributor

laughedelic commented Oct 19, 2017

So, it seems that #17 would take you some time

Well, I don't want to spend too much time on it. But of course it will.

Actually, I made a more thorough review of the available options (see updated #17) and I don't see any perfect one for now. I would actually prefer just to stay with kohsuke/github-api, but solve this pesky resolver issue (btw, I pinged @kohsuke in hub4j/github-api#195, so let's see if he is willing to resolve it).

Have you considered releasing github-api with your organization to Maven Central? It sounds like that would be a time-saving way of fixing this problem.

Several problems with it: using maven, setting up publishing to Maven Central (I never used it) and mainly that the problem is about some dependency of kohsuke/github-api, not the library itself.
So what do I do with it? Publish a fat-jar? 🤔 or publish that dependency and a fork of kohsuke/github-api with that dependency changed? All this doesn't seem like an easy way to solve it.

@jvican
Copy link
Contributor Author

jvican commented Oct 19, 2017

So what do I do with it? Publish a fat-jar? 🤔 or publish that dependency and a fork of kohsuke/github-api with that dependency changed? All this doesn't seem like an easy way to solve it.

This is the best solution short term: publish a farjar in an extra artifact with a -fat classifier. People that want to depend on it can do it right away, people that do not mind adding the resolver can depend on the shallow one.

I think this should be easy enough to set up with sbt-assembly. What do you think?

By the way, thanks for your attention to this! 😄

@laughedelic laughedelic changed the title Release directly to sbt-sonatype Get rid of the extra resolver Oct 19, 2017
@laughedelic
Copy link
Contributor

On a second thought it's not a bad idea indeed 🤔 It is a good short-term solution.

I think this should be easy enough to set up with sbt-assembly

It's already setup by the nice-sbt-settings plugin 👌 So I just need to add assembled jar to publishing. I'll try it now.

@laughedelic
Copy link
Contributor

By the way, thanks for your attention to this! 😄

No problem 😉 I'm interested in solving this issue in particular and moving this plugin forward in general. As I told you elsewhere, I believe that release notes are an essential part of every release. And visibility of release notes is important for happy users 😊 This is the purpose of this plugin.

@jvican
Copy link
Contributor Author

jvican commented Oct 19, 2017

Perfect! I'm already depending on this plugin in sbt-platform, so I acknowledge how important this plugin is, yes 😉.

@laughedelic
Copy link
Contributor

Done: #22 (comment) :shipit:

@jvican
Copy link
Contributor Author

jvican commented Oct 20, 2017

It looks like this approach is not working:

[info] [warn] Choosing local for org.scala-lang.platform#sbt-platform;0.1-SNAPSHOT
[info] [warn] io problem while parsing ivy file: https://repo1.maven.org/maven2/org/jenkins-ci/annotation-indexer/1.4/annotation-indexer-1.4.pom: Impossible to load parent for file:/drone/.ivy2/cache/org.jenkins-ci/annotation-indexer/ivy-1.4.xml.original. Parent=org.jenkins-ci#jenkins;1.26
[info] [warn] 	module not found: org.jenkins-ci#annotation-indexer;1.4
[info] [warn] ==== typesafe-ivy-releases: tried
[info] [warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.jenkins-ci/jenkins//1.26/ivys/ivy.xml
[info] [warn] ==== sbt-plugin-releases: tried
[info] [warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jenkins-ci/jenkins//1.26/ivys/ivy.xml
[info] [warn] ==== local: tried
[info] [warn]   /drone/.ivy2/local/org.jenkins-ci/jenkins//1.26/ivys/ivy.xml
[info] [warn] ==== public: tried
[info] [warn]   https://repo1.maven.org/maven2/org/jenkins-ci/jenkins/1.26/jenkins-1.26.pom
[info] [warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[info] [warn] 	::          UNRESOLVED DEPENDENCIES         ::
[info] [warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[info] [warn] 	:: org.jenkins-ci#annotation-indexer;1.4: not found
[info] [warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[info] [warn] 
[info] [warn] 	Note: Unresolved dependencies path:
[info] [warn] 		org.jenkins-ci:annotation-indexer:1.4
[info] [warn] 		  +- com.infradna.tool:bridge-method-annotation:1.14
[info] [warn] 		  +- org.kohsuke:github-api:1.89
[info] [warn] 		  +- ohnosequences:sbt-github-release:0.5.1 (scalaVersion=2.12, sbtVersion=1.0)
[info] [warn] 		  +- org.scala-lang.platform:sbt-platform:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0) (/tmp/sbt_b4b90613/simple-module/project/plugins.sbt#L1-8)
[info] [warn] 		  +- default:simple-module-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[info] [error] sbt.librarymanagement.ResolveException: unresolved dependency: org.jenkins-ci#annotation-indexer;1.4: not found
[info] [error] 	at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[info] [error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:205)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:229)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:190)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[info] [error] 	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
[info] [error] 	at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
[info] [error] 	at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
[info] [error] 	at xsbt.boot.Using$.withResource(Using.scala:10)
[info] [error] 	at xsbt.boot.Using$.apply(Using.scala:9)
[info] [error] 	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
[info] [error] 	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
[info] [error] 	at xsbt.boot.Locks$.apply0(Locks.scala:31)
[info] [error] 	at xsbt.boot.Locks$.apply(Locks.scala:28)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:185)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:182)
[info] [error] 	at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:228)
[info] [error] 	at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[info] [error] 	at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[info] [error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[info] [error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:38)
[info] [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:91)
[info] [error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[info] [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:104)
[info] [error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[info] [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:104)
[info] [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:87)
[info] [error] 	at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[info] [error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[info] [error] 	at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2353)
[info] [error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[info] [error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[info] [error] 	at sbt.std.Transform$$anon$4.work(System.scala:64)
[info] [error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[info] [error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[info] [error] 	at sbt.Execute.work(Execute.scala:266)
[info] [error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[info] [error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[info] [error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[info] [error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] [error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[info] [error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] [error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[info] [error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[info] [error] 	at java.lang.Thread.run(Thread.java:748)
[info] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? [error] (*:update) sbt.librarymanagement.ResolveException: unresolved dependency: org.jenkins-ci#annotation-indexer;1.4: not found
[error] x sbt-platform-release / simple-module 
[error]  Cause of test exception: {line 9}  Command failed: Remote sbt initialization failed
[error] java.lang.RuntimeException: Failed tests:
[error] 	sbt-platform-release / simple-module
[error] 
[error] 	at scala.sys.package$.error(package.scala:27)
[error] 	at sbt.test.ScriptedRunner.reportErrors(ScriptedTests.scala:392)
[error] 	at sbt.test.ScriptedRunner.runAll(ScriptedTests.scala:395)
[error] 	at sbt.test.ScriptedRunner.run(ScriptedTests.scala:350)
[error] 	at sbt.test.ScriptedRunner.run(ScriptedTests.scala:319)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.lang.reflect.Method.invoke(Method.java:498)
[error] 	at sbt.ScriptedPlugin$.$anonfun$scriptedTask$3(ScriptedPlugin.scala:139)
[error] 	at sbt.ScriptedPlugin$.$anonfun$scriptedTask$3$adapted(ScriptedPlugin.scala:128)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:266)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] (sbt-platform/*:scripted) Failed tests:
[error] 	sbt-platform-release / simple-module
[error] Total time: 65 s, completed Oct 20, 2017 10:47:01 AM

Changing the value of publishMavenStyle doesn't seem to help. Here's the link to the CI for reference: https://platform-ci.scala-lang.org/scalacenter/platform/7.

@jvican
Copy link
Contributor Author

jvican commented Oct 20, 2017

I believe one way to get away with adding the new resolver is to add the leaf sbt plugin that depends on sbt-github-releases as a source dependency. I'll try this out to see if it allows me to avoid adding the resolver in all the projects using the plugin.

@laughedelic
Copy link
Contributor

It looks like this approach is not working

Haha! I understand now: intransitive() is not transitive 😆 Resolution fails on your scripted test which depends on sbt-platform (not this plugin directly) and resolves all its transitive dependencies. I'm not sure how to solve this with sbt tricks on the dependency declaration, but your could try replacing intransitive() with exclude("org.jenkins-ci", "annotation-indexer").

Another way to solve this would be to publish another fat artifact which doesn't have any dependencies in the ivy.xml. I'm also not sure how to do it, but I'll look into this tonight.

@jvican
Copy link
Contributor Author

jvican commented Oct 20, 2017

Yeah, in short intransitive doesn't propagate to the dependent projects.

If I depend on the fat jar of 0.5.1 in the sbt plugin, source dependencies work fantastically. So don't consider this high priority, source dependencies will be the recommended way to consume sbt-platform. 😄

@laughedelic
Copy link
Contributor

@jvican Good news! I just released v0.6.0, which should work well without any extra resolvers or fat-jars. It seems that the problem has been solved upstream: hub4j/github-api#195 (comment).

@jvican
Copy link
Contributor Author

jvican commented Jan 31, 2018

That's good news, thank you for keeping me in the loop.

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

Successfully merging a pull request may close this issue.

2 participants