Sbt ошибка разрешения зависимости хранилища mvn - PullRequest
0 голосов
/ 13 мая 2019

Я пытаюсь добавить эту Java-зависимость в мой проект Scala, но когда я запускаю sbt, он говорит:

[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec/working@HP022L.corp.umbrella.com/jboss-jaxb-api_2.3_spec-working@HP022L.corp.umbrella.com.pom
[warn] ==== sbt-maven-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/maven-releases/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec/working@HP022L.corp.umbrella.com/jboss-jaxb-api_2.3_spec-working@HP022L.corp.umbrella.com.pom
[warn] ==== sbt-maven-snapshots: tried
[warn]   https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec/working@HP022L.corp.umbrella.com/jboss-jaxb-api_2.3_spec-working@HP022L.corp.umbrella.com.pom
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.jboss.spec.javax.xml.bind/jboss-jaxb-api_2.3_spec/working@HP022L.corp.umbrella.com/ivys/ivy.xml
[warn] ==== sbt-ivy-snapshots: tried
[warn]   https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.jboss.spec.javax.xml.bind/jboss-jaxb-api_2.3_spec/working@HP022L.corp.umbrella.com/ivys/ivy.xml
[warn]  module not found: org.reactivestreams#reactive-streams;working@HP022L.corp.umbrella.com
....
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.jboss.spec.javax.xml.bind#jboss-jaxb-api_2.3_spec;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.reactivestreams#reactive-streams;working@HP022L.corp.umbrella.com: not found
[warn]  :: javax.validation#validation-api;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.jboss.spec.javax.annotation#jboss-annotations-api_1.3_spec;working@HP022L.corp.umbrella.com: not found
[warn]  :: javax.activation#activation;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.apache.httpcomponents#httpclient;working@HP022L.corp.umbrella.com: not found
[warn]  :: commons-io#commons-io;working@HP022L.corp.umbrella.com: not found
[warn]  :: net.jcip#jcip-annotations;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.jboss.logging#jboss-logging-annotations;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.jboss.logging#jboss-logging-processor;working@HP022L.corp.umbrella.com: not found
[warn]  :: junit#junit;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.glassfish.jaxb#jaxb-runtime;working@HP022L.corp.umbrella.com: not found
[warn]  :: com.sun.mail#javax.mail;working@HP022L.corp.umbrella.com: not found
[warn]  :: org.apache.james#apache-mime4j;working@HP022L.corp.umbrella.com: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

здесь - это полноеsbt log.

Я не понимаю, почему сегмент версии working@HP022L.corp.umbrella.com вместо номера версии.

Я был бы признателен, если бы кто-то мог указать мне правильное направление, чтобы решить эту ошибку.

это мой build.sbt:

import Dependencies._

ThisBuild / scalaVersion := "2.12.8"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "com.umbrella"
ThisBuild / organizationName := "Umbrella"

lazy val root = (project in file("."))
  .settings(
    name := "custom-mapper",
    libraryDependencies ++= Seq(
      scalaTest % Test,
      "org.keycloak" % "keycloak-core" % "6.0.1",
      "org.keycloak" % "keycloak-server-spi" % "6.0.1" % "provided",
      "org.keycloak" % "keycloak-server-spi-private" % "6.0.1" % "provided",
      "org.jboss.spec.javax.ws.rs" % "jboss-jaxrs-api_2.0_spec" % "1.0.1.Final",
      "org.keycloak" % "keycloak-admin-client" % "6.0.1",
      "org.keycloak" % "keycloak-services" % "6.0.1" % "provided" // this dependency is failing to resolve
    )
  )

sbt resolvers:

sbt:custom-mapper> show fullResolvers
[info] * Raw(ProjectResolver(inter-project, mapped: ))
[info] * FileRepository(local, Patterns(ivyPatterns=Vector(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false), FileConfiguration(true, None))
[info] * FileRepository(local-preloaded-ivy, Patterns(ivyPatterns=Vector(/home/vulcan/.sbt/preloaded/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(/home/vulcan/.sbt/preloaded/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false), FileConfiguration(true, None))
[info] * local-preloaded: file:////home/vulcan/.sbt/preloaded/
[info] * public: https://repo1.maven.org/maven2/
[info] * sbt-maven-releases: https://repo.scala-sbt.org/scalasbt/maven-releases/
[info] * sbt-maven-snapshots: https://repo.scala-sbt.org/scalasbt/maven-snapshots/
[info] * URLRepository(typesafe-ivy-releases, Patterns(ivyPatterns=Vector(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(https://repo.typesafe.com/typesafe/ivy-releases/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false))
[info] * URLRepository(sbt-ivy-snapshots, Patterns(ivyPatterns=Vector(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(https://repo.scala-sbt.org/scalasbt/ivy-snapshots/[organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false))

1 Ответ

1 голос
/ 13 мая 2019

Проблема заключалась в транзитивных зависимостях, и решением было пометить зависимость как непереходную, теперь проект компилируется.

как указано в документах SBT :

Отключить транзитивность

По умолчанию эти объявления извлекают все зависимости проекта, транзитивно. В некоторых случаях вы можете обнаружить, что зависимости перечисленные для проекта не являются необходимыми для его создания. Проекты, использующие например, инфраструктура Felix OSGI требует явного Основной JAR для компиляции и запуска. Избегайте выборки артефактных зависимостей с либо intransitive () или notTransitive (), как в этом примере:

libraryDependencies += "org.apache.felix" % "org.apache.felix.framework" % "1.8.0" intransitive()

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...