无法从SBT中的代理后面的远程存储库下载依赖项

时间:2019-02-01 09:35:11

标签: java scala maven gradle sbt

我正在创建一个POC,试图从我的构建文件位于以下位置的公司存储库(JFrog)下载依赖项:-

build.sbt:-

name := "sbt-test4"

version := "0.1"

scalaVersion := "2.12.8"

resolvers ++= Seq {

  "Artifactory" at "https://someurl/artifactory/packagename"
}
credentials += Credentials(new File("credentials.properties"))

libraryDependencies += "ccp.mts.aerospike" % "mts-aerospike_2.12" % "0.2"

credentials.properties:-

realm=Artifactory Realm
host=https://<url>/artifactory
user=<user-id>
password=<password>

现在我正在运行以下命令:-

    java -Dhttp.proxyHost=162.158.20.9 -Dhttps.proxyHost=162.158.20.9
    -Dhttp.proxyPort=8300 -Dhttps.proxyPort=8300 -Dhttp.nonProxyHosts="*.company.net" -Dhttps.nonProxyHosts="*.company.net" -jar C:\Users\xxxx.xxx034\.IntelliJIdea2018.2\config\plugins\Scala\launcher\sbt-launch.jar
>sbt update

我尝试使用命令本身以及“ sbtconfig.txt”和“ sbtopts”文件传递的代理信息。

即使这些信息我也已经通过evn变量传递,例如:-

JAVA_OPTS = $ JAVA_OPTS -Dhttp.proxyHost = 162.158.20.9 -Dhttps.proxyHost = 162.158.20.9 -Dhttp.proxyPort = 8300 -Dhttps.proxyPort = 8300 -Dhttp.proxyUser = uid-Dhttp.proxyPassword =密码-Dhttps。 proxyUser = uid-Dhttps.proxyPassword =密码

SBT_OPTS = $ SBT_OPTS -Dhttp.proxyHost = 162.158.20.9 -Dhttp.proxyPort = 8300 -Dhttp.proxyUser = uid-Dhttp.proxyPassword =密码-Dhttps.proxyHost = 162.158.20.9 -Dhttps.proxyPort = 8300 -Dhttps。 proxyUser = uid -Dhttps.proxyPassword =密码

但仍然无法从远程存储库获取依赖项。 我也提到过:-

SBT 0.13.11 cannot download dependencies behind a proxy

这是错误日志:-

[info] Set current project to sbt-test4 (in build file:/D:/workspace/scala-intellij/sbt-test4/)
[info] Updating ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: ccp.mts.aerospike#mts-aerospike_2.12;0.2: Artifactory: unable to get resource for ccp/mts/aerospike#mts-aerospike_2.12;0.2: res=https://xxxxxxxxxxxx/artifactory/xxxxxxxxx/ccp/mts/aerospike/mts-aerospike_2.12/0.2/mts-aerospike_2.12-0.2.pom: java.io.IOException: Unexpected response code for CONNECT: 502
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      ccp.mts.aerospike:mts-aerospike_2.12:0.2 (D:\workspace\scala-intellij\sbt-test4\build.sbt#L13-14)
[warn]        +- default:sbt-test4_2.12:0.1
[error] sbt.librarymanagement.ResolveException: unresolved dependency: ccp.mts.aerospike#mts-aerospike_2.12;0.2: Artifactory: unable to get resource for ccp/mts/aerospike#mts-aerospike_2.12;0.2: res=https://xxxxxx/artifactory/xxxxxx/ccp/mts/aerospike/mts-aerospike_2.12/0.2/mts-aerospike_2.12-0.2.pom: java.io.IOException: Unexpected response code for CONNECT: 502
[error]     at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
[error]     at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
[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:238)
[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:45)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89)
[error]     at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2561)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: ccp.mts.aerospike#mts-aerospike_2.12;0.2: Artifactory: unable to get resource for ccp/mts/aerospike#mts-aerospike_2.12;0.2: res=https://xxxxxxx/artifactory/xxxxxxx/ccp/mts/aerospike/mts-aerospike_2.12/0.2/mts-aerospike_2.12-0.2.pom: java.io.IOException: Unexpected response code for CONNECT: 502
[error]     at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
[error]     at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
[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:238)
[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:45)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89)
[error]     at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2561)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: ccp.mts.aerospike#mts-aerospike_2.12;0.2: Artifactory: unable to get resource for ccp/mts/aerospike#mts-aerospike_2.12;0.2: res=https://xxxxxxxx/artifactory/xxxxxxx/ccp/mts/aerospike/mts-aerospike_2.12/0.2/mts-aerospike_2.12-0.2.pom: java.io.IOException: Unexpected response code for CONNECT: 502
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: unresolved dependency: ccp.mts.aerospike#mts-aerospike_2.12;0.2: Artifactory: unable to get resource for ccp/mts/aerospike#mts-aerospike_2.12;0.2: res=https://xxxxxxxxxxx/artifactory/xxxxxxxxxxx/ccp/mts/aerospike/mts-aerospike_2.12/0.2/mts-aerospike_2.12-0.2.pom: java.io.IOException: Unexpected response code for CONNECT: 502
[error] Total time: 3 s, completed Feb 1, 2019 12:43:15 PM
[info] shutting down server
Picked up _JAVA_OPTIONS: -Xmx1024m

无论是哪个sbt URL(错误日志)都需要下载以下载依赖项,我在浏览器中输入的URL都是相同的,并且在提供用户凭据之后我可以取消依赖项。

请让我知道是否有人对此有任何解决方案。

0 个答案:

没有答案