0
私はリゾルバにSSH Ivyリポジトリを追加しようとしています。SBTリゾルバにIvy SSHリポジトリを追加するには?
私はStackOverflowの上でさまざまなスレッドに基づいて試してみました何:
Relevant part of buid.sbt
val intResolver = Seq[Resolver](
{
import java.io.File
val privateKeyFile: File = new File(sys.env("HOME") + "/.ssh/id_rsa")
val userName = sys.env("SCN_USER_NAME")
Resolver.ssh("int-scn-snapshot-repository", "scn.int.com")(Patterns(
"/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact].[ext]",
"/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact]-[type].[ext]"
)
) as(userName, privateKeyFile) withPermissions("0644")
}
)
resolvers ++= intResolver
val exportFullResolvers = taskKey[Unit]("debug resolvers")
exportFullResolvers := {
for {
(resolver,idx) <- fullResolvers.value.zipWithIndex
} println(s"${idx}. ${resolver.name}")
}
fullResolvers := {
val previous = fullResolvers.value
previous.sortWith { (lhs, rhs) => if (lhs.name.contains("int-scn")) true else false }
}
exportFullResolvers
の出力:
> exportFullResolvers
0. int-scn-snapshot-repository
1. inter-project
2. local
3. public
[success] Total time: 0 s, completed Jun 15, 2016 8:57:42 AM
update
の出力:リゾルバ:検査の
[info] Updating {file:/home/mozart/eng/IVAAPBackendRD/}root...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Updating {file:/home/mozart/eng/IVAAPBackendRD/}common...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Resolving com.interactive.ivaap#IVAAPWitsmlDataSource;SNAPSHOT ...
[warn] module not found: com.interactive.ivaap#IVAAPWitsmlDataSource;SNAPSHOT
[warn] ==== local: tried
[warn] /home/mozart/.ivy2/local/com.interactive.ivaap/IVAAPWitsmlDataSource/SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/interactive/ivaap/IVAAPWitsmlDataSource/SNAPSHOT/IVAAPWitsmlDataSource-SNAPSHOT.pom
[info] Resolving com.interactive.ivaap#IVAAPCommonObjects;1 ...
[warn] module not found: com.interactive.ivaap#IVAAPCommonObjects;1
[warn] ==== local: tried
[warn] /home/mozart/.ivy2/local/com.interactive.ivaap/IVAAPCommonObjects/1/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/interactive/ivaap/IVAAPCommonObjects/1/IVAAPCommonObjects-1.pom
[info] Resolving jline#jline;2.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.interactive.ivaap#IVAAPWitsmlDataSource;SNAPSHOT: not found
[warn] :: com.interactive.ivaap#IVAAPCommonObjects;1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.interactive.ivaap:IVAAPWitsmlDataSource:SNAPSHOT (/home/mozart/eng/IVAAPBackendRD/build.sbt#L68)
[warn] +- com.acme:ivaap-common_2.11:0.11
[warn] com.interactive.ivaap:IVAAPCommonObjects:1 (/home/mozart/eng/IVAAPBackendRD/build.sbt#L68)
[warn] +- com.acme:ivaap-common_2.11:0.11
[trace] Stack trace suppressed: run last common/*:update for the full output.
[error] (common/*:update) sbt.ResolveException: unresolved dependency: com.interactive.ivaap#IVAAPWitsmlDataSource;SNAPSHOT: not found
出力
> inspect compile:resolvers
[info] Setting: scala.collection.Seq[sbt.Resolver] = List(SshRepository(int-scn-snapshot-repository,SshConnection(Some(KeyFileAuthentication(mozart.brocchini,/home/mozart/.ssh/id_rsa,None)),Some(scn.int.com),None),Patterns(ivyPatterns=WrappedArray(/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact].[ext], /export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact]-[type].[ext]), artifactPatterns=WrappedArray(/export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact].[ext], /export/repository/maven2/snapshot/[organisation]/[module]/[revision]/[artifact]-[type].[ext]), isMavenCompatible=true, descriptorOptional=false, skipConsistencyCheck=false),Some(0644)))
[info] Description:
[info] The user-defined additional resolvers for automatically managed dependencies.
[info] Provided by:
[info] {file:/home/mozart/eng/IVAAPBackendRD/}root/*:resolvers
[info] Defined at:
[info] /home/mozart/eng/IVAAPBackendRD/build.sbt:17
[info] Delegates:
[info] root/compile:resolvers
[info] root/*:resolvers
[info] {.}/compile:resolvers
[info] {.}/*:resolvers
[info] */compile:resolvers
[info] */*:resolvers
[info] Related:
[info] root/*:resolvers
[info] */*:resolvers
これが唯一のサブプロジェクトのひとつで使用されるマルチプロジェクトビルド、問題の依存関係であることに注意してください。これは、私がリゾルバを移動し、何らかの形でそのサブプロジェクトに関連付ける必要があることを意味しますか?
> inspect common/update:resolvers
[info] Setting: scala.collection.Seq[sbt.Resolver] = List()
[info] Description:
[info] The user-defined additional resolvers for automatically managed dependencies.
[info] Provided by:
[info] */*:resolvers
[info] Defined at:
[info] (sbt.Classpaths) Defaults.scala:1122
[info] Delegates:
[info] common/update:resolvers
[info] common/*:resolvers
[info] {.}/update:resolvers
[info] {.}/*:resolvers
[info] */update:resolvers
[info] */*:resolvers
[info] Related:
[info] root/*:resolvers
[info] */*:resolvers
>
なぜ私のSSH Ivyリポジトリが依存関係解決を参照していないのですか?
何共通/更新検査 'について:resolvers'をあなたはこのようなものを使用することができますか? –
質問に追加しました。 –
これは答えです - 一般的なモジュールリゾルバは空リストです。 'resolvers'の代わりに' ThisBuild'のリゾルバを使うようにしてください。 –