Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java sbt构建失败-未找到模块:org.scala sbt#sbt;0.13.5_Java_Scala_Web_Sbt - Fatal编程技术网

Java sbt构建失败-未找到模块:org.scala sbt#sbt;0.13.5

Java sbt构建失败-未找到模块:org.scala sbt#sbt;0.13.5,java,scala,web,sbt,Java,Scala,Web,Sbt,我试图调整现有Scala项目的sbt构建,但没有成功,该项目以前运行良好,但留下了所有文档。似乎用不正确的URL来解决“sbt.jar”的依赖性 内部我的项目目录: ear application.xml web-logic-application.xml project target config-classes *.class src main java package(java-utils)

我试图调整现有Scala项目的sbt构建,但没有成功,该项目以前运行良好,但留下了所有文档。似乎用不正确的URL来解决“sbt.jar”的依赖性

内部我的项目目录:

ear
    application.xml
    web-logic-application.xml
project
    target
      config-classes
        *.class
src
    main
      java
        package(java-utils)
      scala
        package(scala)
        my_app.properties
        spring.xml
        ...
      webapp
        WEB-INF
          web.xml
    test
      scala
      resources
 build.sbt
我的项目/build.sbt

name := "my_project"

organization := "my.app"

version := "1.0"

scalaVersion := "2.10.2"
...
libraryDependencies += ...
[repositories]
local

maven-central

typesafe: http://repo.typesafe.com/typesafe/releases/

typesafe-snapshots: http://repo.typesafe.com/typesafe/snapshots/
resolvers += "typesave" at "http://repo.typesafe.com/typesafe/releases"

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
C:\Users\svc\.sbt\repositories

name := "my_project"

organization := "my.app"

version := "1.0"

scalaVersion := "2.10.2"
...
libraryDependencies += ...
[repositories]
local

maven-central

typesafe: http://repo.typesafe.com/typesafe/releases/

typesafe-snapshots: http://repo.typesafe.com/typesafe/snapshots/
resolvers += "typesave" at "http://repo.typesafe.com/typesafe/releases"

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
C:\Users\svc\.sbt\0.13.5\plugins\plugins.sbt

name := "my_project"

organization := "my.app"

version := "1.0"

scalaVersion := "2.10.2"
...
libraryDependencies += ...
[repositories]
local

maven-central

typesafe: http://repo.typesafe.com/typesafe/releases/

typesafe-snapshots: http://repo.typesafe.com/typesafe/snapshots/
resolvers += "typesave" at "http://repo.typesafe.com/typesafe/releases"

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
C:\Program Files(x86)\sbt\conf\sbtconfig.txt(在本地PC上安装sbt后未更改):

日志显示:

Getting org.scala-sbt sbt 0.13.5 ...

:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#sbt;0.13.5

    ==== local: tried

      C:\Users\svc\.ivy2\local\org.scala-sbt\sbt\0.13.5\ivys\ivy.xml

      -- artifact org.scala-sbt#sbt;0.13.5!sbt.jar:

      C:\Users\svc\.ivy2\local\org.scala-sbt\sbt\0.13.5\jars\sbt.jar

    ==== Maven Central: tried

      http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.pom

      -- artifact org.scala-sbt#sbt;0.13.5!sbt.jar:

      http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar

    ==== typesafe: tried

      http://repo.typesafe.com/typesafe/releases/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.pom

      -- artifact org.scala-sbt#sbt;0.13.5!sbt.jar:

      http://repo.typesafe.com/typesafe/releases/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.scala-sbt#sbt;0.13.5: not found

        ::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS
    Server access Error: Connection refused: connect url=http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.pom

    Server access Error: Connection refused: connect url=http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar

    Server access Error: Connection refused: connect url=http://repo.typesafe.com/typesafe/releases/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.pom

    Server access Error: Connection refused: connect url=http://repo.typesafe.com/typesafe/releases/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar
...
真的-我能看到“sbt”在那边 但由于URL是由框架生成的,因此它不存在:

通过http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar 或超过


有人建议吗?

您是否尝试删除
~/.sbt/repositories
文件?默认值应该足够了

如果这仍然不起作用,请尝试将sbt启动器更新到最新版本

另外,在
my_project/project
目录中有一个文件
build.properties
,其中有一行:

sbt.version=0.13.6
sbt.version=0.13.6

这将强制项目使用sbt版本,而不是使用启动器版本。

最新可行的变体

my_project\build.sbt看起来像:

name := "my_project"

organization := "my.app"

version := "1.0"

scalaVersion := "2.10.2"

resolvers ++= Seq[sbt.Resolver](
    "Local Maven Repository@wildfly" at "file:///M:/",
    "Local Maven Repository@common" at "file:///" + Path.userHome.absolutePath + "/.m2/repository"
)

seq(webSettings :_*)
...
libraryDependencies += ...
C:\Users\svc\.sbt\repositories-已删除

C:\ProgramFiles(x86)\sbt\bin中放置sbt-launch.jar

build.properties放置在my_project/project文件夹中,该行位于:

sbt.version=0.13.6
sbt.version=0.13.6
(什么版本-没关系,它适用于任何0.13。~版本-我检查过)

plugins.sbt放入C:\Users\svc.sbt\0.13\plugins文件夹中,其中包含以下行:

resolvers += "typesave" at "http://repo.typesafe.com/typesafe/releases"

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
# Set the java args to high
-Xms1G
-Xmx2G
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
# Set the extra SBT options
-DproxySet=true
-Dsbt.log.format=true

#-Dhttp.proxyHost=my-proxy-in.com
#-Dhttp.proxyPort=8080
#-Dhttps.proxyHost=my-proxy-in.com
#-Dhttps.proxyPort=8080
#-Dhttp.proxyUser=my_user
#-Dhttp.proxyPassword="my_psw"

-Dhttp.proxyHost=my-proxy-out.com
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=my-proxy-out.com
-Dhttps.proxyPort=8080
已删除C:\Users\svc\.sbt\0.13.5

sbtconfig.txt放置在C:\Program Files(x86)\sbt\conf目录中,其中包含以下行:

resolvers += "typesave" at "http://repo.typesafe.com/typesafe/releases"

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
# Set the java args to high
-Xms1G
-Xmx2G
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
# Set the extra SBT options
-DproxySet=true
-Dsbt.log.format=true

#-Dhttp.proxyHost=my-proxy-in.com
#-Dhttp.proxyPort=8080
#-Dhttps.proxyHost=my-proxy-in.com
#-Dhttps.proxyPort=8080
#-Dhttp.proxyUser=my_user
#-Dhttp.proxyPassword="my_psw"

-Dhttp.proxyHost=my-proxy-out.com
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=my-proxy-out.com
-Dhttps.proxyPort=8080

如果某些人工制品被放置在公司封闭网络中(对我来说就是这样),您应该运行两次sbt,使用两个不同的代理(注释/未注释)。

尝试安装ssl证书。您可以尝试使用下面的命令。它帮助我解决了同样的问题。(Ubuntu 15.04)


仅删除
build.properties
没有帮助。在使用
sbt.version=0.13.6
artifacts创建
my_project/project
之后,开始下载。非常感谢。不幸的是,这是第一个障碍。。。将发布最终结果。删除
~/.sbt/repositories
非常有用。我遇到了一个类似的问题,我们的Nexus存储库配置不正确。通过删除存储库文件,您可以确定可以访问类型安全存储库进行下载。这应该是公认的答案。一个解释会很有用。windows的等价物是什么?