deploy scalatra app on heroku error plugin not found - eclipse

I followed the guide of deploying a Scalatra app on Heroku [lien] http://www.scalatra.org/guides/deployment/heroku.html#toc_177 and I get the following error:
> [error] (*:update) sbt.ResolveException: unresolved dependency: >com.typesafe.startscript#xsbt-start-script-plugin;0.5.3: not found
My version of SBT is 0.13.0..
For information I'm debutante with scalatra and sbt,Please can you help me..

As you already mentioned your sbt version is 0.13.0 so:
on https://github.com/sbt/sbt-start-script
there are instructions for 0.13.0 version. So we need to:
Use
com.typesafe.sbt.SbtStartScript.startScriptForClassesSettings: _* instead of com.typesafe.startscript.StartScriptPlugin.startScriptForClassesSettings: _* in build.scala and
In project/plugins.sbt we need to add start script plugin like addSbtPlugin("com.typesafe.sbt" % "sbt-start-script" % "0.10.0") instead of ddSbtPlugin("com.typesafe.startscript" % "xsbt-start-script-plugin" % "0.5.3")
And as a bonus: don’t forget to change servlet name in src/main/scala/JettyLauncher.scala to one you have e.g. com.blog.BlogServlet instead of one in tutorial com.example.app.MyScalatraServlet

Related

Scala Play and Multi Project SBT Builds

I created a scala play project like this
activator new foo play-event-sourcing-starter
the project was generated successfully and I can go inside and easily compile and run the app.
However what I want is that I should have a multi project sbt build. I googled and found this https://www.playframework.com/documentation/2.5.x/SBTSubProjects
But this is not the same as what I want because here they have play as the root project. whereas what I want is that I have an empty root project with a build.sbt file and then multiple "peer" projects. One of them is play.
So I changed the steps to
mkdir -p LearnPlay/project
cd LearnPlay
activator new foo play-event-sourcing-starter
Now I went inside foo and moved the build.sbt to the LearnPlay directory. I also moved the build.properties and plugins.sbt files into LearnPlay/project folder.
I edited the build.sbt file so that the root project becomes
lazy val root = (project in file("foo")).enablePlugins(PlayScala)
However now sbt cannot compile the project anymore and it cannot find any of the play framework dependencies.
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-server_2.10;2.5.9: not found
unresolved dependency: com.typesafe.play#play-netty-server_2.10;2.5.9: not found
unresolved dependency: com.typesafe.play#play-logback_2.10;2.5.9: not found
unresolved dependency: com.typesafe.play#play-test_2.10;2.5.9: not found
unresolved dependency: com.typesafe.play#play-omnidoc_2.10;2.5.9: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
These are the contents of my plugins.sbt file. The resolver is defined correctly so I am not sure why sbt will not be able to find the dependencies after the file was moved from sub-project to root project. it was able to resolve everything when the file was in the project directory of the foo project.
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.9")
// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
The thing that gave me some ideas what's the problem there is:
unresolved dependency: com.typesafe.play#play-server_2.10;2.5.9: not found
Aren't you surprised, that sbt tries to download the version of play server for Scala 2.10, which doesn't exist for Play 2.5.x, since it's already out of lifecycle.
In my projects this is happening, if I'm not specifying scala version in build.sbt or set it to the 2.10, e.g.
lazy val root = (project in file("foo")).settings(
scalaVersion := "2.10.6",
so, I think you just need to add scalaVersion parameter and set it to something from 2.11.x or 2.12.x

scalatra issue when running ./sbt: sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;2.1.1: not found

I tried adding eclipse support to my project by running ./sbt eclipse after adding addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.1") to project/plugins.sbt.
I get this error message
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;2.1.1: not found
I created the project by g8 using the simplest template. I'm trying to add eclipse support
[Edit: sbt version]
Detected sbt version 0.13.0
Starting sbt: invoke with -help for other options
Using /Users/andre/.sbt/0.13.0 as sbt dir, -sbt-dir to override.
Which version of sbt are you using? typesafehub/sbteclipse says the latest is 2.3.0 for sbt 0.13, and 2.2.0 for sbt 0.12.

Lifty and SBT 0.12

I'm new to using SBT, and I'm trying to install and configure Lifty, however when I try to run sbt, I get the following error:
[error] (*:update) sbt.ResolveException: unresolved dependency: org.lifty#lifty;1.7.4: not found
As per the Installing the Plugin instructions for Lifty, my ~/.sbt/plugins/build.sbt file looks like:
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("org.lifty" % "lifty" % "1.7.4")
And my ~/.sbt/build.sbt file includes the line:
seq( Lifty.liftySettings : _*)
However, when trying to run this, I get the SBT error listed above, and I get a similar error if I try to use the 1.7.5-SNAPSHOT version of Lifty instead.
I'm using SBT launcher version 0.12.0 and Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17) on Ubuntu 12.10.
Thank you!
You are using the wrong definition. Here is what you need;
resolvers += Resolver.url("sbt-plugin-snapshots", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots/"))(Resolver.ivyStylePatterns)
addSbtPlugin("org.lifty" % "lifty" % "1.7.4")
If you want to make this available for all projects, then put in ~/.sbt/plugins/plugins.sbt. Otherwise it goes in: ProjectFolder/project/plugins.sbt
But they don't have a Scala 2.10 or SBT 0.12 release out.. Look HERE for what is available.

Installing sbteclipse

i have problems top use sbteclipse
What I have done:
went to my global sbt folder.
created a plugins folder
created the file plugins.sbt with addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
went to my eclipse project and created a build.sbt file
it contains:
name := "foo"
version := "1.0"
scalaVersion := "2.9.2"
libraryDependencies += "net.java.dev.jna" % "jna" % "3.4.0"
I am selecting the project folder in my cmd. and type sbt eclipse
But I always get the following error
[error] Not a valid command: eclipse (similar: help, alias)
[error] Not a valid project ID: eclipse
[error] Expected ':'
[error] Not a valid key: eclipse (similar: deliver, licenses, clean)
[error] eclipse
[error] ^
ps: I am using Windows. I am also using sbt 0.12
Your global sbt folder is at %USERPROFILE%\.sbt (C:\Users\<username>\.sbt most likely). So your plugins should be defined at %USERPROFILE%\.sbt\plugins\plugins.sbt
Failing this you can add it to your project directly. Add the file path is <project_root>\project\plugins.sbt. If the project directory doesn't exist you will need to create it.
I think that I might have found a solution. First, the default directory checked for plugins configuration is 'USER_HOME/.sbt/plugins' and NOT 'USER_HOME/.sbt/0.13/plugins'.
Secondly, the sbt version specified seems to matter. In 'PROJECT_HOME/project/build.properties', there's an 'sbt.version' property. If the version of sbt specified in this file is different from the actually installed version of sbt, there's likely to be an issue. I think I was affected more so by this because I'm using an Activator template and it already had 'sbt.version' specified in this 'build.properties' file.
While nosing around, I came across this
"Support for plugin configuration in project/plugins/ has been removed. It was deprecated since 0.11.2" from sbt website at http://www.scala-sbt.org/0.13.0/docs/Community/ChangeSummary_0.13.0.html. I still see a lot of guys pointing that it should be configured in 'PROJECT_HOME/projects/plugins.sbt'. I think this is very confusing.
I had similar a issue and answered to a similar question.
I tried "everything" and, eventually, I just had to update my sbt from 0.13.1 to 0.13.9.

Getting started with Lift and Lifty

I am trying to get started with the Lift framework, reading Lift in Action. I would like to follow along with the examples, but I immediately stumble into a problem with installing Lift. I know that there are various ways to get started easily with Lift, but I would like to use Lifty, as the book does, to be able to follow it.
The problem is that both Lifty and sbt (and Lift too!) have moved forward since the book was published. I installed sbt from the Typesafe repository for Ubuntu. Now I am stuck trying to install Lifty.
Following Lifty documentation and this answer on SO - due to the fact that Lifty has not released a binary for sbt 0.11.3 - I figured I should put the following in ~/.sbt/plugins/build.sbt:
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("org.lifty" % "lifty" % "1.7.4")
libraryDependencies +=
Defaults.sbtPluginExtra(
"org.lifty" % "lifty" % "1.7.4",
"0.11.2",
"2.9.1"
)
The latter is to tell sbt to use the Lifty plugin for sbt 0.11.2.
Now sbt seems to be able to download Lifty and starts correctly, but I do not have a lifty command. So when I do
lifty learn lift https://raw.github.com/Lifty/lifty/master/lifty-recipe/lifty.json
sbt complains:
[error] Not a valid key: lifty (similar: history)
[error] lifty learn lift https://raw.github.com/Lifty/lifty/master/lifty-recipe/lifty.json
[error] ^
How should I install Lifty? Please note that I am new to Scala, sbt and Lift.
EDIT
I managed to install Lifty by downgrading to sbt 0.7.7. But then if I do
> lift create project-blank
> reload
> update
I get the error
[error] sbt.ResolveException: unresolved dependency: net.liftweb#lift-webkit_2.9.1;2.3-RC3: not found
[error] unresolved dependency: org.scala-tools.testing#specs_2.9.1;1.6.6: not found
[info] == update ==
[error] Error running update: sbt.ResolveException: unresolved dependency: net.liftweb#lift-webkit_2.9.1;2.3-RC3: not found
[error] unresolved dependency: org.scala-tools.testing#specs_2.9.1;1.6.6: not found
I hate to break it to you, but lifty is gone. As of this writing, sbt's stable is 0.13.0. Looking at sbt community repo, the only version that was released was 1.7.4 for sbt 0.11.2.
The official website says:
The Lift Cookbook is the most up-to-date resource to learn how to use Lift.
There's a section named Creating a Lift Project from Scratch Using SBT:
Problem
You want want to create a Lift web project from scratch without using the ZIP files provided on the official Lift website.
Solution
You will need to configure SBT and the Lift project yourself. Luckily, only five small files are needed.
First, create an SBT plugin file at project/plugins.sbt (all filenames are given relative to the project root directory):
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.3.0")
This file tells SBT that you will be using the xsbt-web-plugin.
Next, create an SBT build file, build.sbt...
Unfortunately xsbt-web-plugin 0.3.0 is for sbt 0.12. So you have to either use sbt 0.12, or modify the instruction a bit. The latest xsbt-web-plugin for sbt 0.13 is 0.4.2, so in project/plugins.sbt put:
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.4.2")
resolvers += Resolver.sonatypeRepo("public")
I was able to follow along with the rest of instructions on the page...
Eventually I got everything pulled in by sbt 0.13, and was able to start the container:
> container:start
[info] Compiling 1 Scala source to /foo/sbt-lift-test/target/scala-2.10/classes...
[info] jetty-8.1.7.v20120910
....
[success] Total time: 2 s, completed Sep 20, 2013 10:34:22 PM
Open http://localhost:8080/ using the browser:
Welcome, you now have a working Lift installation