如何修复“无效”在Scala的构建工具(SBT)中



在新鲜的Ubuntu 17.10安装上,我根据文档安装了Scala构建工具(SBT(:

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt

运行SBT时,要么只是为了获取其版本,要么是为了构建项目,我会得到此错误:

Getting org.scala-sbt sbt 1.1.0  (this may take some time)...
:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#sbt;1.1.0
    ==== local: tried
      /home/philipp/.ivy2/local/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
      -- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
      /home/philipp/.ivy2/local/org.scala-sbt/sbt/1.1.0/jars/sbt.jar
    ==== local-preloaded-ivy: tried
      file:////home/philipp/.sbt/preloaded/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
    ==== local-preloaded: tried
      file:////home/philipp/.sbt/preloaded/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
      -- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
      file:////home/philipp/.sbt/preloaded/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    ==== Maven Central: tried
      https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
      -- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
      https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    ==== sbt-maven-releases: tried
      https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
      -- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
      https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    ==== sbt-maven-snapshots: tried
      https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
      -- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
      https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    ==== typesafe-ivy-releases: tried
      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
    ==== sbt-ivy-snapshots: tried
      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.scala-sbt#sbt;1.1.0: not found
        ::::::::::::::::::::::::::::::::::::::::::::::

:::: ERRORS
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
    Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml

:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;1.1.0: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/philipp/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 1.1.0

这是我的Java版本:

$ java --version
openjdk 9-Ubuntu
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)

我不知道发生了什么。如何再次启动并再次运行?

在我的情况下,在Ubuntu 18.04 Bionic和SBT 1.1.6,强迫重新安装ca-certificates-java将问题解决为解决方案。

sudo dpkg --purge --force-depends ca-certificates-java
sudo apt install ca-certificates-java

请注意--force-depends选项不会损坏您的安装。

在我的情况下,我必须清除:

sudo apt purge openjdk-9-jdk openjdk-8-jdk java-common

(仅清除和重新安装JDK还不够,此后我仍然有一个java命令。只有清除java-common也会消失然后重新安装。(

之后,我再次重新安装了Java(我仅选择了OpenJDK-9(:

sudo apt install openjdk-9-jdk

这个触发:Running hooks in /etc/ca-certificates/update.d...并添加了许多证书文件。现在我的SBT建造很成功:

$ sbt
Getting org.scala-sbt sbt 1.1.0  (this may take some time)...
downloading https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#sbt;1.1.0!sbt.jar (657ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/main_2.12/1.1.0/main_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#main_2.12;1.1.0!main_2.12.jar (4298ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/logic_2.12/1.1.0/logic_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#logic_2.12;1.1.0!logic_2.12.jar (185ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/actions_2.12/1.1.0/actions_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#actions_2.12;1.1.0!actions_2.12.jar (309ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/main-settings_2.12/1.1.0/main-settings_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#main-settings_2.12;1.1.0!main-settings_2.12.jar (1543ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/run_2.12/1.1.0/run_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#run_2.12;1.1.0!run_2.12.jar (397ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/command_2.12/1.1.0/command_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#command_2.12;1.1.0!command_2.12.jar (670ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/collections_2.12/1.1.0/collections_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#collections_2.12;1.1.0!collections_2.12.jar (517ms)
downloading https://repo1.maven.org/maven2/com/github/cb372/scalacache-caffeine_2.12/0.20.0/scalacache-caffeine_2.12-0.20.0.jar ...
    [SUCCESSFUL ] com.github.cb372#scalacache-caffeine_2.12;0.20.0!scalacache-caffeine_2.12.jar (96ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/io_2.12/1.1.3/io_2.12-1.1.3.jar ...
    [SUCCESSFUL ] org.scala-sbt#io_2.12;1.1.3!io_2.12.jar (479ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-logging_2.12/1.1.2/util-logging_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-logging_2.12;1.1.2!util-logging_2.12.jar (1161ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/librarymanagement-core_2.12/1.1.2/librarymanagement-core_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#librarymanagement-core_2.12;1.1.2!librarymanagement-core_2.12.jar (1813ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/librarymanagement-ivy_2.12/1.1.2/librarymanagement-ivy_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#librarymanagement-ivy_2.12;1.1.2!librarymanagement-ivy_2.12.jar (1679ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.1.0/compiler-interface-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#compiler-interface;1.1.0!compiler-interface.jar (363ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-compile_2.12/1.1.0/zinc-compile_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-compile_2.12;1.1.0!zinc-compile_2.12.jar (113ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-relation_2.12/1.1.2/util-relation_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-relation_2.12;1.1.2!util-relation_2.12.jar (131ms)
downloading https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-scalajson_2.12/0.8.2/sjson-new-scalajson_2.12-0.8.2.jar ...
    [SUCCESSFUL ] com.eed3si9n#sjson-new-scalajson_2.12;0.8.2!sjson-new-scalajson_2.12.jar (161ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-position_2.12/1.1.2/util-position_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-position_2.12;1.1.2!util-position_2.12.jar (146ms)
downloading https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-core_2.12/0.8.2/sjson-new-core_2.12-0.8.2.jar ...
    [SUCCESSFUL ] com.eed3si9n#sjson-new-core_2.12;0.8.2!sjson-new-core_2.12.jar (930ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/completion_2.12/1.1.0/completion_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#completion_2.12;1.1.0!completion_2.12.jar (2066ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/task-system_2.12/1.1.0/task-system_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#task-system_2.12;1.1.0!task-system_2.12.jar (747ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/tasks_2.12/1.1.0/tasks_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#tasks_2.12;1.1.0!tasks_2.12.jar (299ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/testing_2.12/1.1.0/testing_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#testing_2.12;1.1.0!testing_2.12.jar (481ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-tracking_2.12/1.1.2/util-tracking_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-tracking_2.12;1.1.2!util-tracking_2.12.jar (161ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-classpath_2.12/1.1.0/zinc-classpath_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-classpath_2.12;1.1.0!zinc-classpath_2.12.jar (241ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-apiinfo_2.12/1.1.0/zinc-apiinfo_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-apiinfo_2.12;1.1.0!zinc-apiinfo_2.12.jar (524ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-ivy-integration_2.12/1.1.0/zinc-ivy-integration_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-ivy-integration_2.12;1.1.0!zinc-ivy-integration_2.12.jar (231ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc_2.12/1.1.0/zinc_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc_2.12;1.1.0!zinc_2.12.jar (267ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-control_2.12/1.1.2/util-control_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-control_2.12;1.1.2!util-control_2.12.jar (109ms)
downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.5.0/jna-4.5.0.jar ...
    [SUCCESSFUL ] net.java.dev.jna#jna;4.5.0!jna.jar (2551ms)
downloading https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/4.5.0/jna-platform-4.5.0.jar ...
    [SUCCESSFUL ] net.java.dev.jna#jna-platform;4.5.0!jna-platform.jar (2357ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.1.2/util-interface-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-interface;1.1.2!util-interface.jar (87ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/util-cache_2.12/1.1.2/util-cache_2.12-1.1.2.jar ...
    [SUCCESSFUL ] org.scala-sbt#util-cache_2.12;1.1.2!util-cache_2.12.jar (238ms)
downloading https://repo1.maven.org/maven2/com/eed3si9n/sjson-new-murmurhash_2.12/0.8.2/sjson-new-murmurhash_2.12-0.8.2.jar ...
    [SUCCESSFUL ] com.eed3si9n#sjson-new-murmurhash_2.12;0.8.2!sjson-new-murmurhash_2.12.jar (97ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/test-agent/1.1.0/test-agent-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#test-agent;1.1.0!test-agent.jar (161ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-classfile_2.12/1.1.0/zinc-classfile_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-classfile_2.12;1.1.0!zinc-classfile_2.12.jar (225ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-compile-core_2.12/1.1.0/zinc-compile-core_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-compile-core_2.12;1.1.0!zinc-compile-core_2.12.jar (930ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-core_2.12/1.1.0/zinc-core_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-core_2.12;1.1.0!zinc-core_2.12.jar (705ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/zinc-persist_2.12/1.1.0/zinc-persist_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#zinc-persist_2.12;1.1.0!zinc-persist_2.12.jar (2494ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/core-macros_2.12/1.1.0/core-macros_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#core-macros_2.12;1.1.0!core-macros_2.12.jar (193ms)
downloading https://repo1.maven.org/maven2/org/scala-sbt/protocol_2.12/1.1.0/protocol_2.12-1.1.0.jar ...
    [SUCCESSFUL ] org.scala-sbt#protocol_2.12;1.1.0!protocol_2.12.jar (512ms)
downloading https://repo1.maven.org/maven2/com/github/cb372/scalacache-core_2.12/0.20.0/scalacache-core_2.12-0.20.0.jar ...
    [SUCCESSFUL ] com.github.cb372#scalacache-core_2.12;0.20.0!scalacache-core_2.12.jar (193ms)
:: retrieving :: org.scala-sbt#boot-app
    confs: [default]
    74 artifacts copied, 0 already retrieved (27445kB/73ms)

相关内容

  • 没有找到相关文章

最新更新