Sergey Sergey - 8 days ago 6
Java Question

sbt build failed - module not found: org.scala-sbt#sbt;0.13.5

I'm unsuccessfully trying to adjust sbt build for the existiing Scala project which previously worked fine but any docs was left. It seems that incorrect URL is substituted to resolve dependancy for "sbt.jar"...

Inside my_project dir:

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


my_project/build.sbt:

name := "my_project"

organization := "my.app"

version := "1.0"

scalaVersion := "2.10.2"
...
libraryDependencies += ...


C:\Users\svc\ .sbt\repositories:

[repositories]
local

maven-central

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

typesafe-snapshots: http://repo.typesafe.com/typesafe/snapshots/


C:\Users\svc\ .sbt\0.13.5\plugins\plugins.sbt:

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 (wasn't changed after sbt installation on local PC):

# Set the java args to high */

-Xmx512M

-XX:MaxPermSize=256m

-XX:ReservedCodeCacheSize=128m



# Set the extra SBT options */

-Dsbt.log.format=true


Log shows:

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
...


Really - I can see "sbt" over http://repo.typesafe.com/typesafe/releases/org.scala-sbt/sbt/0.13.5/jars/sbt.jar
but it is absent over URL is generated by framework:

over http ://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar
or over http://repo.typesafe.com/typesafe/releases/org/scala-sbt/sbt/0.13.5/sbt-0.13.5.jar

Can anybody suggest?

Answer

The latest workable variant.

my_project\build.sbt looks like that:

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 - removed

Placed sbt-launch.jar in C:\Program Files (x86)\sbt\bin

Placed build.properties in the my_project/project folder with that line inside:

sbt.version=0.13.6

(what version is - doesn't matter, it works with any 0.13.~ version - I checked)

Placed plugins.sbt in the C:\Users\svc.sbt\0.13\plugins folder with that lines inside:

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")

Removed C:\Users\svc\ .sbt\0.13.5

Placed sbtconfig.txt in C:\Program Files (x86)\sbt\conf directory with that lines inside:

# 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

In case of some artefacts placed in corporate closed network (as it is for me) you should run sbt twice - with 2 different proxies (commented/uncommented).