本地Maven存储库已添加到SBT但仍未使用

时间:2017-08-29 10:07:50

标签: sbt

SBT 0.13.13的奇怪问题:

我明确地将本地Maven存储库添加到构建中(下面的最后一个依赖项应该来自哪个):

resolvers in ThisBuild += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"

lazy val lostchildDataImpl = project("lostchild-data-impl")
  .settings(
    //resolvers += Resolver.mavenLocal,
    version := "1.0-SNAPSHOT"

    , libraryDependencies ++= Seq(
      lagomJavadslApi,
      lagomJavadslJackson,
      lagomJavadslPersistenceCassandra,
      lagomJavadslTestKit,
      lagomJavadslPubSub
    , lagomJavadslKafkaBroker
    )

    , libraryDependencies += "com.huawei.aspen" % "lagom" % "1.0-SNAPSHOT"
  )

我可以看到它被正确添加:

> show lostchild-data-impl/resolvers
[info] * Local Maven Repository: file:///home/aromanov/.m2/repository
> show lostchild-data-impl/externalResolvers
[info] * FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false))
[info] * URLRepository(ivy-proxy,Patterns(ivyPatterns=List(http://10.122.85.159:9081/nexus/content/groups/sbt-plugins/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(http://10.122.85.159:9081/nexus/content/groups/sbt-plugins/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false))
[info] * maven-proxy: http://10.122.85.159:9081/nexus/content/groups/public
[info] * Local Maven Repository: file:///home/aromanov/.m2/repository

但是没有访问存储库。在调试级别上,我看到:

> lostchild-data-impl/update
... lots of output for other dependencies
[debug] == resolving dependencies com.huawei.cloud#lostchild-data-impl_2.11;1.0-SNAPSHOT->com.huawei.aspen#lagom;1.0-SNAPSHOT [compile->default(compile)]
[debug] dependency descriptor has been mediated: dependency: org.scala-lang#scala-compiler;2.11.8 {scala-tool=[default, optional(default)]} => dependency: org.scala-lang#scala-compiler;2.11.8 {scala-tool=[default, optional(default)]}
[debug] dependency descriptor has been mediated: MergedDescriptors(dependency: org.scala-lang#scala-library;2.11.8 {scala-tool=[default, optional(default)]},dependency: org.scala-lang#scala-library;2.11.8 {compile=[default(compile)]}) => dependency: org.scala-lang#scala-library;2.11.8 {scala-tool=[default, optional(default)], compile=[default(compile)]}
[info] Resolving com.huawei.aspen#lagom;1.0-SNAPSHOT ...
[debug] sbt-chain: Checking cache for: dependency: com.huawei.aspen#lagom;1.0-SNAPSHOT {compile=[default(compile)]}
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[info] Resolving com.huawei.aspen#lagom;1.0-SNAPSHOT ...
[debug] sbt-chain-delegate is changing. Checking all resolvers on the chain
[debug] sbt-chain-delegate: Checking cache for: dependency: com.huawei.aspen#lagom;1.0-SNAPSHOT {compile=[default(compile)]}
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[debug]         tried /home/aromanov/.ivy2/local/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[debug]     local: no ivy file found for com.huawei.aspen#lagom;1.0-SNAPSHOT
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[debug] CLIENT ERROR: Not Found url=https://repo1.maven.org/maven2/com/huawei/aspen/lagom/1.0-SNAPSHOT/maven-metadata.xml
[debug]     maven-metadata not available: https://repo1.maven.org/maven2/com/huawei/aspen/lagom/1.0-SNAPSHOT/maven-metadata.xml
[debug]         tried https://repo1.maven.org/maven2/com/huawei/aspen/lagom/1.0-SNAPSHOT/lagom-1.0-SNAPSHOT.pom
[debug] CLIENT ERROR: Not Found url=https://repo1.maven.org/maven2/com/huawei/aspen/lagom/1.0-SNAPSHOT/lagom-1.0-SNAPSHOT.pom
[debug]     public: no ivy file found for com.huawei.aspen#lagom;1.0-SNAPSHOT
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[debug]         tried https://repo.typesafe.com/typesafe/ivy-releases/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[debug] CLIENT ERROR: Not Found url=https://repo.typesafe.com/typesafe/ivy-releases/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[debug]     typesafe-ivy-releases: no ivy file found for com.huawei.aspen#lagom;1.0-SNAPSHOT
[debug] don't use cache for com.huawei.aspen#lagom;1.0-SNAPSHOT: changing=true
[debug]         tried https://repo.scala-sbt.org/scalasbt/ivy-snapshots/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[debug] CLIENT ERROR: Not Found url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[debug]     sbt-ivy-snapshots: no ivy file found for com.huawei.aspen#lagom;1.0-SNAPSHOT
[warn]  module not found: com.huawei.aspen#lagom;1.0-SNAPSHOT
[warn] ==== local: tried
[warn]   /home/aromanov/.ivy2/local/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/huawei/aspen/lagom/1.0-SNAPSHOT/lagom-1.0-SNAPSHOT.pom
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml
[warn] ==== sbt-ivy-snapshots: tried
[warn]   https://repo.scala-sbt.org/scalasbt/ivy-snapshots/com.huawei.aspen/lagom/1.0-SNAPSHOT/ivys/ivy.xml

我还尝试将resolvers移动到项目设置中或使用Resolver.mavenLocal而不是明确指定路径。在类似的问题中,直接添加到externalResolvers代替resolvers为某人工作。在我的案例中都没有帮助。

0 个答案:

没有答案