Плагин SBT добавлен как зависимость в моей опубликованной библиотеке - PullRequest
0 голосов
/ 05 ноября 2018

Недавно я выпустил свою первую библиотеку Scala & Scala.js для сборки в Sonatype. Теперь я хочу использовать библиотеку Scala.js в одном из моих приложений, однако, если я хочу добавить зависимость к моей библиотеке, используя:

libraryDependencies += "com.github.fbaierl" %%% "scala-tarjan" % "0.1.1"

(вот библиотека: https://search.maven.org/artifact/com.github.fbaierl/scala-tarjan_sjs0.6_2.12/0.1.1/jar)

Я всегда получаю эту Неразрешенную ошибку ЗАВИСИМОСТИ:

[info] Updating ...
[warn]  module not found: com.jsuereth#sbt-pgp;1.1.1
[warn] ==== local: tried
[warn]   C:\Users\BAIERLF\.ivy2\local\com.jsuereth\sbt-pgp\scala_2.12\sbt_1.0\1.1.1\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/jsuereth/sbt-pgp_2.12_1.0/1.1.1/sbt-pgp-1.1.1.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   C:\Users\BAIERLF\.sbt\preloaded\com.jsuereth\sbt-pgp\1.1.1\ivys\ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:/C:/Users/BAIERLF/.sbt/preloaded/com/jsuereth/sbt-pgp_2.12_1.0/1.1.1/sbt-pgp-1.1.1.pom
[warn] ==== Artima Maven Repository: tried
[warn]   http://repo.artima.com/releases/com/jsuereth/sbt-pgp_2.12_1.0/1.1.1/sbt-pgp-1.1.1.pom
[warn] ==== jcenter: tried
[warn]   https://jcenter.bintray.com/com/jsuereth/sbt-pgp_2.12_1.0/1.1.1/sbt-pgp-1.1.1.pom
[info] downloading https://repo1.maven.org/maven2/com/github/fbaierl/scala-tarjan_2.12/0.1.1/scala-tarjan_2.12-0.1.1.jar ...
[info]  [SUCCESSFUL ] com.github.fbaierl#scala-tarjan_2.12;0.1.1!scala-tarjan_2.12.jar (460ms)
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.jsuereth#sbt-pgp;1.1.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.jsuereth:sbt-pgp:1.1.1 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          com.jsuereth:sbt-pgp:1.1.1 (scalaVersion=2.12, sbtVersion=1.0)
[warn]            +- com.github.fbaierl:scala-tarjan_2.12:0.1.1 (C:\Users\BAIERLF\Documents\...\build.sbt#L23-24)
[warn]            +- xxx:xxx_sjs0.6_2.12:0.1.0-SNAPSHOT
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.jsuereth#sbt-pgp;1.1.1: not found
[error]         at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:334)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:243)
[error]         at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error]         at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error]         at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error]         at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error]         at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error]         at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error]         at xsbt.boot.Using$.withResource(Using.scala:10)
[error]         at xsbt.boot.Using$.apply(Using.scala:9)
[error]         at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error]         at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error]         at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]         at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]         at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:242)
[error]         at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193)
[error]         at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error]         at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error]         at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:46)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:99)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:112)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:112)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:95)
[error]         at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:126)
[error]         at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2385)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:66)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:271)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error]         at java.util.concurrent.FutureTask.run(Unknown Source)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error]         at java.util.concurrent.FutureTask.run(Unknown Source)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error]         at java.lang.Thread.run(Unknown Source)
[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: com.jsuereth#sbt-pgp;1.1.1: not found
[error] Total time: 5 s, completed 05.11.2018 11:01:32

Меня очень смущает, почему com.jsuereth#sbt-pgp;1.1.1 в первую очередь рассматривается как зависимость, но она также включена в XML-схему maven:

<dependency>
  <groupId>com.jsuereth</groupId>
  <artifactId>sbt-pgp</artifactId>
  <version>1.1.1</version>
</dependency>

Насколько я понимаю, я никогда не добавлял эту зависимость, просто использовал этот плагин sbt (см .: здесь ).

Вот мой build.sbt: https://github.com/fbaierl/scalajs-cross-compile-tarjan/blob/d4153b98d8be42f2751eae0f057bea284882c24f/build.sbt

Edit:

Может быть проблема в том, что я добавил эту строку: addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") к своему project/plugins.sbt вместо его глобальной установки в ~/.sbt/1.0/plugins/gpg.sbt? (Но я видел, что другие проекты делали то же самое, поэтому я не думаю, что это проблема?)

Редактировать 2:

dependencyTree дает мне следующие зависимости:

 sbt:scalajs-cross-compile-tarjan> dependencyTree
[info] Updating ProjectRef(uri("file:/home/florian/Documents/scalajs-cross-compile-tarjan/"), "tarjanJVM")...
[info] Updating ProjectRef(uri("file:/home/florian/Documents/scalajs-cross-compile-tarjan/"), "root")...
[info] Updating ProjectRef(uri("file:/home/florian/Documents/scalajs-cross-compile-tarjan/"), "tarjanJS")...
[info] Done updating.
[info] com.github.fbaierl:scala-tarjan_2.12:0.1.1 [S]
[info]   +-org.scalactic:scalactic_2.12:3.0.5 [S]
[info]     +-org.scala-lang:scala-reflect:2.12.4 [S]
[info]     
[info] Done updating.
[info] com.github.fbaierl:scala-tarjan_sjs0.6_2.12:0.1.1 [S]
[info]   +-org.scala-js:scalajs-library_2.12:0.6.22 [S]
[info]   +-org.scalactic:scalactic_2.12:3.0.5 [S]
[info]     +-org.scala-lang:scala-reflect:2.12.4 [S]
[info]     
[info] Done updating.
[info] scalajs-cross-compile-tarjan:scalajs-cross-compile-tarjan_2.12:0.1.0-SNAPSHOT [S]
...