Cannot install new 0.11.3 sbt on Ubuntu 10.04LTS - scala

This process used to work fine in 0.11.2 but the recent change w.r.t to sbt group ID changed to org.scala-sbt (from org.scala-tools.sbt) seems to have broken a dependency.
I've got a 10.04 LTS machine to which I added the Typesafe deb repository using the deb package file, described in: https://github.com/harrah/xsbt/wiki/Getting-Started-Setup.
When I try to install from the repo I get:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-tools.sbt#scripted-plugin_2.9.1;0.11.3: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] module not found: org.scala-tools.sbt#scripted-plugin_2.9.1;0.11.3
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/scripted-plugin_2.9.1/0.11.3/ivys/ivy.xml
[warn] ==== local: tried
[warn] /home/jasonmaclulich/.ivy2/local/org.scala-tools.sbt/scripted-plugin_2.9.1/0.11.3/ivys/ivy.xml
[warn] ==== Typesafe Repo: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/scripted- plugin_2.9.1/0.11.3/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-tools/sbt/scripted-plugin_2.9.1/0.11.3/scripted-plugin_2.9.1-0.11.3.pom
How do I instruct sbt to look for scripted-plugin at the right group id?
I also tried a manual install with this launcher (following the UNIX install instructions):
//typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.11.3-2/sbt-launch.jar
And I still get the following unresolved dependency:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-tools.sbt#scripted-plugin_2.9.1;0.11.3: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Thoughts?
Thanks, Jason.

I thought I'd update this with how I got around it, if I explicitly set the version of sbt to 0.11.2 in my project/build.properties file, i.e., sbt.version=0.11.2.
Detected sbt version 0.11.2
Cannot find sbt launcher 0.11.2
Please download:
From http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2/sbt-launch.jar
To /home/<username>/.sbt/.lib/0.11.2/sbt-launch.jar
I then installed the required files and I was able to continue compiling like I was used to.
While it isn't a direct solution it does let me continue with work.

I've installed latest SBT on Ubuntu successfully, but indirectly, by installing Typesafe Stack.

By now, sbt-0.11.3-build-0100 is available (http://apt.typesafe.com/pool/pool/main/s/sbt/), so you should be able to simply upgrade to solve your problem. If that doesn't work or if you're curious about the original problem, here's my diagnosis.
As you tried to do, you do need to use a new launcher for SBT 0.11.3 to use the new group ID, org.scala-sbt. Your second error message still shows a failure which refers to org.scala-tools.sbt - that's bad, and suggests you're in fact still using the old launcher.
Could you make sure that when you're launching sbt, you're launching the script you created and not the one from the Debian package? Please try using the full path for launching sbt, for instance ~/bin/sbt.
If that helps, you should fix the PATH so that ~/bin (or wherever you installed your script) comes before the directory where the system SBT is installed, which (I would say, but it's a matter of opinion) is generally useful.

Related

Scala Play Framework download failed: com.typesafe.play#play_2.10;2.2.6!play_2.10.jar

I'm working with one of the old Scala project created using Play Framework 2.2.6. I'm trying to build and run the project locally. But, facing this error whenever I run play clean compile.
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.play#play_2.10;2.2.6!play_2.10.jar(src)
[warn] :: com.typesafe.play#play-test_2.10;2.2.6!play-test_2.10.jar(src)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: download failed: com.typesafe.play#play_2.10;2.2.6!play_2.10.jar(src)
download failed: com.typesafe.play#play-test_2.10;2.2.6!play-test_2.10.jar(src)
Following are the repos, I've set in ~/.sbt/repositories.
[repositories]
maven-central: https://repo1.maven.org/maven2/
typesafe-repo: https://repo.typesafe.com/typesafe/maven-releases
ivy-repo: https://repo.typesafe.com/typesafe/ivy-releases
Not sure how to download these two specific mentioned in error.
In Maven, the organization com.typesafe.play is closed, the repository is not available anymore.
Two choices:
Build or find private play repositories
Migrate to more recent play version (https://www.playframework.com/documentation/2.3.x/Migration23)
You are getting this error because Play Framework 2.2.6 has not been compiled and released against your current Scala version which is 2.10 (check here). You should probably use different versions.

Upgraded to sbt 0.13.9; now I cannot launch sbt

I upgraded sbt from version 0.13.8 to 0.13.9. We have Nexus proxying many repositories. Now, when I issue 'sbt' command - I get unresolved dependencies
scala-library
scala-compilre
scala-reflect
all due to sha1 different from the computed. Is there a way to bypass sha1 validation?
FYI. setting checksums in update := Nil in build.sbt does not solve the problem. I even tried putting
<property name="ivy.checksums" value=""/> in ~/.ivy/ivysettings.xml still fails.
here is the console output:
D:\Temp\test>sbt -v update
Getting org.scala-sbt sbt 0.13.9 ...
:: problems summary ::
:::: WARNINGS
problem while downloading module descriptor: http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-library/2.10.5/scala-library-2.10.5.pom: invalid sha1: expected=c39e31e37ce77d8d5fb8e8c640222275815d36f2 computed=4e8b721680f2defb491fe90447302658d464d5c
0 (351ms)
module not found: org.scala-lang#scala-library;2.10.5
==== local: tried
C:\Users\ak\.ivy2\local\org.scala-lang\scala-library\2.10.5\ivys\ivy.xml
-- artifact org.scala-lang#scala-library;2.10.5!scala-library.jar:
C:\Users\ak\.ivy2\local\org.scala-lang\scala-library\2.10.5\jars\scala-library.jar
==== my-ivy-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/ivy-releases/org.scala-lang/scala-library/2.10.5/ivys/ivy.xml
==== my-maven-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-library/2.10.5/scala-library-2.10.5.pom
problem while downloading module descriptor: http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-compiler/2.10.5/scala-compiler-2.10.5.pom: invalid sha1: expected=9a85822af1f9ea46b49dfdfa99eafc0bd819abaf computed=c3e0b6cf2f45a5a7cb052ef9e00f8fdac55e7
1b7 (69ms)
module not found: org.scala-lang#scala-compiler;2.10.5
==== local: tried
C:\Users\ak\.ivy2\local\org.scala-lang\scala-compiler\2.10.5\ivys\ivy.xml
-- artifact org.scala-lang#scala-compiler;2.10.5!scala-compiler.jar:
C:\Users\ak\.ivy2\local\org.scala-lang\scala-compiler\2.10.5\jars\scala-compiler.jar
==== my-ivy-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/ivy-releases/org.scala-lang/scala-compiler/2.10.5/ivys/ivy.xml
==== my-maven-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-compiler/2.10.5/scala-compiler-2.10.5.pom
problem while downloading module descriptor: http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-reflect/2.10.5/scala-reflect-2.10.5.pom: invalid sha1: expected=3a6fa11041ac0c8b4d5fcf9d4f1372ba8c0b7216 computed=30f1f646114a79eeefb254ead190f045c460564
9 (67ms)
module not found: org.scala-lang#scala-reflect;2.10.5
==== local: tried
C:\Users\ak\.ivy2\local\org.scala-lang\scala-reflect\2.10.5\ivys\ivy.xml
-- artifact org.scala-lang#scala-reflect;2.10.5!scala-reflect.jar:
C:\Users\ak\.ivy2\local\org.scala-lang\scala-reflect\2.10.5\jars\scala-reflect.jar
==== my-ivy-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/ivy-releases/org.scala-lang/scala-reflect/2.10.5/ivys/ivy.xml
==== my-maven-proxy-releases: tried
http://nexusserver:8081/nexus/content/groups/mvn-repositories/org/scala-lang/scala-reflect/2.10.5/scala-reflect-2.10.5.pom
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-lang#scala-library;2.10.5: not found
:: org.scala-lang#scala-compiler;2.10.5: not found
:: org.scala-lang#scala-reflect;2.10.5: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-lang#scala-library;2.10.5: not found
unresolved dependency: org.scala-lang#scala-compiler;2.10.5: not found
unresolved dependency: org.scala-lang#scala-reflect;2.10.5: not found
Error during sbt execution: Error retrieving required libraries
(see C:\Users\ak\.sbt\boot\update.log for complete log)
Error: Could not retrieve sbt 0.13.9
It turned out to be an ordering issue with our Nexus proxy repositories. oss.sonatype.org maven repo was causing an issue when it was placed ahead of the Maven Central repo. Removing oss.sonatype.org maven repository solved the problem.

New sbt "feature" configuration not found in X / unresolved (transitive) dependencies

A rather recent new "feature" in sbt, perhaps 0.13.7 or 0.13.8, is a very annoying behaviour that transitive dependencies are not found any longer.
For example. I have a project A that depends on library B version 1.25.1 that depends on library C version 1.13.1. Only library dependency B is defined in A, naturally, because I don't want to define the whole tree of dozens of sub-libraries. Ok, this builds.
Now I update the dependency in A to become library B version 1.25.2 which in turn depends on library C version 1.13.2. Now sbt complains with the rather useless message "configuration not found in library-C;1.13.2: 'master'. It was required from library-B;1.25.2 compile", followed by an "unresolved dependency" exception. Sbt doesn't even bother to download library C version 1.13.2 from Maven Central or in fact find it already published locally. The only way to "solve" this is to add a depenency on library C version 1.13.2 to project A, which is precisely what I don't want to do.
Here is an example print out:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: de.sciss#scalacolliderugens-core_2.11;1.13.2: configuration not found in de.sciss#scalacolliderugens-core_2.11;1.13.2: 'master'. It was required from de.sciss#scalacolliderswing-core_2.11;1.25.2 compile
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] de.sciss:scalacolliderugens-core_2.11:1.13.2
[warn] +- de.sciss:scalacolliderugens-plugins_2.11:1.13.2
[warn] +- de.sciss:scalacolliderswing-core_2.11:1.25.2 (/home/hhrutz/Documents/devel/SoundProcesses/build.sbt#L167)
[warn] +- de.sciss:soundprocesses-compiler_2.11:2.20.0-SNAPSHOT
I suppose this is an annoying bug in sbt, or is there some deeper reasoning behind the failure to resolve transitive dependencies that I fail to understand?
The problem even came back a while after I had added library C explicitly. As often, the final solution was this:
$ rm -r ~/.ivy2/cache/
$ rm -r ~/.ivy2/local/
And then download the Internet again.

Installing ensime in existing project cannot resolve dependency

I started an android project in scala recently, I'm an emacs nerd, and I wanted to use ensime in emacs instead of IntelliJ. Per the installation instructions, and this post:
Installing Ensime for Scala Development on emacs: sbt.ResolveException: unresolved dependency: org.ensime#ensime-sbtt-cmd;0.12: not found
my ~/.sbt/plugins/plugins.sbt looks like this:
resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/snapshots"
addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.2")
and my project's project/plugins.sbt looks like this:
addSbtPlugin("org.scala-sbt" % "sbt-android" % "0.7.1-SNAPSHOT")
(though I don't think that's related).
When I run sbt, the output looks like the following:
[info] Loading global plugins from /Users/jmiles/.sbt/plugins
[info] Updating {file:/Users/jmiles/.sbt/plugins/}default-bdeac8...
[info] Resolving org.ensime#ensime-sbt-cmd;0.1.2 ...
[warn] module not found: org.ensime#ensime-sbt-cmd;0.1.2
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/jmiles/.ivy2/local/org.ensime/ensime-sbt-cmd/scala_2.9.2/sbt_0.12/0.1.2/ivys/ivy.xml
[warn] ==== Sonatype releases: tried
[warn] https://oss.sonatype.org/content/repositories/snapshots/org/ensime/ensime-sbt-cmd_2.9.2_0.12/0.1.2/ensime-sbt-cmd-0.1.2.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/ensime/ensime-sbt-cmd_2.9.2_0.12/0.1.2/ensime-sbt-cmd-0.1.2.pom
[info] Resolving org.scala-sbt#precompiled-2_10_0-m7;0.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.ensime#ensime-sbt-cmd;0.1.2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.ensime:ensime-sbt-cmd:0.1.2 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: org.ensime#ensime-sbt-cmd;0.1.2: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:102)
at sbt.IvySbt.liftedTree1$1(Ivy.scala:49)
(etc.)
Any help?
I get this all the time with dependencies. While I have no explanation for it, here are the common patterns that recur over and over.
Often, the code given by the plugin/library developer is wrong. When I go to their maven repository the version they have listed doesn't exist in the repository. I just update it to the right version and then boom it works. Also, for some reason some plugins work when I put them in plugins.sbt (the suggested place). While others only work if I stick them in project/build.sbt. It doesn't make sense, but as soon as I move it there it suddenly installs and runs. Combined dependency listings. If you are hacking stuff together and stick a dependency in both build.scala and build.sbt, it will throw a generic error that is completely unhelpful. Remove one or the other and suddenly it runs.
Also keep in mind that % causes a scala version to be appended to the name of it. whereas %% defines the name explicitly. Sometimes this causes errors when using % because it doesn't have a version available for that scala version. Go to the repository and enter the name of the package explicitly to fix this.
ensime 0.1.2 is only for sbt version 0.13.x. If this is a new project, you might consider using the current version of sbt. Typically you'd do this by creating project/build.properties that contains sbt.version=0.13.0

Understanding How SBT, Scala, SBT-Idea and Play Framework Work Together

I am new and had built some simple Scala applications / tutorials using SBT. I move on to Play framework and generated an empty project using g8 typesafehub/play-scala. I did a few tests to make sure it was properly generated. That checked out good and I added sbt-idea plugin, https://github.com/mpeltonen/sbt-idea, to generate an IntelliJ project. This is where the hell broke loose.
I had to find the right Scala, SBT, Play framework and sbt-idea versions combinations to get it compiled perfectly. Otherwise, the compilation would broke with out right errors or warnings that got me guessing. So far, the best "combination" I had was
Scala 2.9.2
Play 2.0.1
SBT 0.11.2
sbt-idea 1.1.0
with the following warning
[warn] [NOT FOUND ] maven-plugins#maven-cobertura-plugin;1.3!maven-cobertura-plugin.plugin (282ms)
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/maven-plugins/maven-cobertura-plugin/1.3/maven-cobertura-plugin-1.3.plugin
[warn] [NOT FOUND ] maven-plugins#maven-findbugs-plugin;1.3.1!maven-findbugs-plugin.plugin (284ms)
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/maven-plugins/maven-findbugs-plugin/1.3.1/maven-findbugs-plugin-1.3.1.plugin
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: maven-plugins#maven-cobertura-plugin;1.3!maven-cobertura-plugin.plugin
[warn] :: maven-plugins#maven-findbugs-plugin;1.3.1!maven-findbugs-plugin.plugin
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
If I use the latest versions, SBT 0.12 and Play 2.0.3 I would get a complilating error. Any idea or explanation how I can get all these works together nicely? It is a version mess to me right now. Thanks
I think that you should start with Play from the original site: http://www.playframework.org/ you'll find there newest stable version for download (currently it's 2.0.3).
It contains proper dependencies and its installation is as easy as unpacking the ZIP and exporting the path as described in: Installing doc.
I can ensure you that this approach is the easiest and most sure way, it works as expected, creates proper IntelliJ projects etc. If I'm not wrong IntelliJ support was fixed after 2.0.1 also other indices had some improvements, so there is no sense to fight with 2.0.1 if it isn't really required.