作为 sbt 依赖项添加时找不到 jboss 拦截器 api 1.1
Posted
技术标签:
【中文标题】作为 sbt 依赖项添加时找不到 jboss 拦截器 api 1.1【英文标题】:jboss interceptor api 1.1 not found when added as sbt dependency 【发布时间】:2017-06-17 09:22:24 【问题描述】:我正在尝试通过 sbt 将 jboss-interceptor-api-1.1 设置为依赖项,但找不到。我在 Maven Repository 上搜索过,有这个版本,有人可以帮我吗?
实际上,我正在尝试使用 sbt-assembly。删除插件依赖并将依赖添加到 libraryDependencies 仍然显示该错误。
堆栈跟踪:
[info] Resolving org.jboss.interceptor#jboss-interceptor-api;1.1 ...
[info] Resolving org.jboss.interceptor#jboss-interceptor-api;1.1 ...
[warn] problem while downloading module descriptor: https://repo1.maven.org/maven2/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom: invalid sha1: expected=453b712ff6cda3a3f10f46a9ab9b9a42fc9bc021 computed=56da14e5a3e7e5656fe2ed1942d9fc0c1f3b054b (122ms)
[warn] module not found: org.jboss.interceptor#jboss-interceptor-api;1.1
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/vicaba/.ivy2/local/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom
[warn] ==== activator-launcher-local: tried
[warn] /Users/vicaba/.activator/repository/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn] /Applications/activator-dist-1.3.12/repository/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== typesafe-releases: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[info] Resolving javax.annotation#jsr250-api;1.0 ...
[info] Resolving javax.inject#javax.inject;1 ...
[info] Resolving org.eclipse.sisu#org.eclipse.sisu.inject;0.3.0 ...
[info] Resolving org.codehaus.plexus#plexus-component-annotations;1.5.5 ...
[info] Resolving org.codehaus.plexus#plexus-classworlds;2.5.2 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.jboss.interceptor#jboss-interceptor-api;1.1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info] Resolving com.typesafe.scala-logging#scala-logging_2.11;3.4.0 ...
[info] Resolving org.scala-lang#scala-library;2.11.8 ...
[info] Resolving org.slf4j#slf4j-api;1.7.21 ...
[info] Resolving ch.qos.logback#logback-core;1.1.7 ...
[info] Resolving ch.qos.logback#logback-classic;1.1.7 ...
[info] Resolving org.scala-lang#scala-reflect;2.11.8 ...
[info] Resolving org.scala-lang.modules#scala-parser-combinators_2.11;1.0.4 ...
[info] Resolving org.scala-lang#scala-compiler;2.11.8 ...
[info] Resolving org.scala-lang.modules#scala-xml_2.11;1.0.4 ...
[info] Resolving jline#jline;2.12.1 ...
[trace] Stack trace suppressed: run 'last *:updateSbtClassifiers' for the full output.
[error] (*:updateSbtClassifiers) sbt.ResolveException: unresolved dependency: org.jboss.interceptor#jboss-interceptor-api;1.1: not found
[error] Total time: 5 s, completed Feb 1, 2017 9:51:26 AM
【问题讨论】:
我也遇到了这个问题,我也在使用 sbt-assembly,也在使用 IntelliJ。老实说,我认为这与 IntelliJ 有关,可能是最新更新中的某些内容,因为命令行中的 SBT 工作正常。 快速跟进:在项目的 SBT 设置下,我禁用了“下载 SBT 和插件的源代码”,并且能够继续。 我是另一个遇到此问题的 intellij 用户 - 禁用该选项也对我有用 我也使用 intellij。 @Seer 的建议也对我有用。 在 sbt-assembly 中跟踪这个的问题是 #236 【参考方案1】:LCartwright 是正确的,这是因为 SHA-1 哈希文件与 maven Central 上的 POM 的哈希不同。
要解决这个问题,您可以将 the hash 匹配的 JBoss maven 存储库添加到 global sbt config ~/.sbt/0.13/global.sbt 中的解析器
resolvers += "JBoss" at "https://repository.jboss.org/"
【讨论】:
我在 JBoss 工件下载后采取了删除额外解析器的步骤,因为拥有不必要的解析器可能是一件危险的事情:theguardian.com/info/developer-blog/live/2015/sep/21/… 按照罗伯托的建议,我后来删除了额外的解析器;编译仍然有效,但出现此警告:SBT 项目导入 [警告] 下载模块描述符时出现问题:repo1.maven.org/maven2/org/jboss/interceptor/…: invalid sha1: expected=453b712ff6cda3a3f10f46a9ab9b9a42fc9bc021 computed=56da14e5a3e7e5656fe2ed1942d9fc0c1f3b054b (100ms) 修复 sha 是唯一真正的解决方案:issues.jboss.org/browse/JBINTER-21【参考方案2】:我在 IntelliJ 中遇到了同样的问题。打开项目时,它在 jboss-interceptor-api 上失败。这是日志的一部分:
[info] Resolving org.apache.maven#maven-artifact;3.2.2 ...
[info] Resolving org.apache.maven#maven-plugin-api;3.2.2 ...
[info] Resolving org.eclipse.sisu#org.eclipse.sisu.plexus;0.0.0.M5 ...
[info] Resolving javax.enterprise#cdi-api;1.0 ...
[info] Resolving org.jboss.interceptor#jboss-interceptor-api;1.1 ...
[info] Resolving org.jboss.interceptor#jboss-interceptor-api;1.1 ...
[warn] problem while downloading module descriptor: https://repo1.maven.org/maven2/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom: invalid sha1: expected=453b712ff6cda3a3f10f46a9ab9b9a42fc9bc021 computed=56da14e5a3e7e5656fe2ed1942d9fc0c1f3b054b (108ms)
[warn] module not found: org.jboss.interceptor#jboss-interceptor-api;1.1
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/jessedobbelaere/.ivy2/local/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom
[warn] ==== bintray-kamon-io-sbt-plugins: tried
[warn] https://dl.bintray.com/kamon-io/sbt-plugins/org.jboss.interceptor/jboss-interceptor-api/1.1/ivys/ivy.xml
我注意到在 IntelliJ 中取消选中“下载 SBT 和插件的源代码”时,一切正常
【讨论】:
谢谢,这对我来说是一个临时修复。你知道这个的根本原因吗?我刚刚从 2016.1 升级到 IntelliJ 2016.3.4,这不是问题。 难以置信! IDEA 有一些很棒的 Scala 特性。但是像这样的错误让我怀疑它是否值得。 (在 2017.1 和最新的 EAP 中仍然存在)【参考方案3】:看来罪魁祸首就是这条线
[warn] problem while downloading module descriptor: https://repo1.maven.org/maven2/org/jboss/interceptor/jboss-interceptor-api/1.1/jboss-interceptor-api-1.1.pom: invalid sha1: expected=453b712ff6cda3a3f10f46a9ab9b9a42fc9bc021 computed=56da14e5a3e7e5656fe2ed1942d9fc0c1f3b054b (108ms)
报告 pom 文件的 SHA-1 不正确。
pom:jboss-interceptor-api-1.1.pom pom SHA-1:jboss-interceptor-api-1.1.pom.sha1pom 的 SHA-1 是 56da14e5a3e7e5656fe2ed1942d9fc0c1f3b054b
但随附的 pom.sha1
文件是 453b712ff6cda3a3f10f46a9ab9b9a42fc9bc021
如上所述,取消选中“下载 SBT 和插件的源代码”将暂时解决您的问题。不知道该联系谁来更新pom.sha1
【讨论】:
取消选中“下载 SBT 和插件的源代码” - 经过数小时的努力解决了我的问题。【参考方案4】:我今天遇到了同样的问题,我使用的插件是sbt-native-packager
。当我禁用该选项时它也有效。
后来我去 sbt github 站点,将我的 sbt 插件版本从 1.0.0-RC1
更新到 1.2.0-M8
而不禁用该选项,我也工作了。我用的插件是
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.0-M8")
也许你可以去https://github.com/sbt搜索最新版本。
【讨论】:
以上是关于作为 sbt 依赖项添加时找不到 jboss 拦截器 api 1.1的主要内容,如果未能解决你的问题,请参考以下文章
sbt找不到ebean依赖项(一些未解析的依赖项有额外的属性)
损坏的序列化解析结果。使用firebase ui依赖项时找不到选定的模块