sbt stage : not a valid command - scala

I am trying to follow the tutorial for scala and spray with this great template : http://typesafe.com/activator/template/activator-akka-spray
Then I follow instruction for Heroku deployment : https://devcenter.heroku.com/articles/getting-started-with-scala
I encounter a problem when running the command "sbt clean compile stage" in order to prepare a deployment on Heroku. Here is the error message :
[info] Loading project definition from /.../activator-akka-spray/project
[info] Set current project to activator-akka-spray (in build file:/.../activator-akka-spray/)
[error] Not a valid command: stage (similar: last-grep, set, last)
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: stage (similar: state, target, tags)
[error] stage
[error] ^
Has anyone encountered a similar error ?
Thanks in advance for any help.

Add the StartScriptPlugin from Typesafe in the build.sbt, as mentioned in the documentation.

Related

Compiling kafka schema-registry fails for building kafka-connect-hdfs

I'm trying to build kafka-connect-hdfs by following this FAQ.
While trying to compile schema-registry, I get the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-
compiler-plugin:3.6.1:compile (default-compile) on project kafka-
schema-registry-client: Compilation failure
[ERROR] /Users/workspace-name/kafka-connect/schema- registry/client/src/main/java/io/confluent/kafka/schemaregistry/client/s ecurity/basicauth/SaslBasicAuthCredentialProvider.java:[40,42] cannot find symbol
[ERROR] symbol: method
loadClientContext(java.util.Map<java.lang.String,java.lang.Object>)
[ERROR] location: class org.apache.kafka.common.security.JaasContext
Are any modifications required? Appreciate any suggestions. Thanks

Using Play 2.4 with a renamed `conf/routes` file

My simple Play 2.4 project does not compile when I rename the conf/routes file to something else, e.g. conf/hello.routes. The reason I'm doing this is to enable composition of APIs while allowing them to be developed in separate git repositories and sbt projects.
The idea of multiproject support is based on this project and blog post - but that's using Play 2.3.
The error I get is:
$ sbt test
...
[info] Hello should
[error] ! give {hello: true}
[error] Unable to provision, see the following errors:
[error]
[error] 1) Error in custom provider, java.lang.ClassCastException: interface play.api.routing.Router is not assignable from class hello.routes
[error] while locating play.api.test.FakeRouterProvider
[error] while locating play.api.routing.Router
[error]
[error] 1 error (InjectorImpl.java:1025)
[error] com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
[error] com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
[error] play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
[error] play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
...
Got this resolved (code in the git repo now works).
The problems were likely connected to both of these:
the Controller implementation wants to be within a package controllers.hello instead of just hello
in the application.conf file one should omit the controllers namespace, i.e.
play.http.router = app.Routes
I learned this simply by comparing this code with samples that work.

failed to compile dataflow sample

I tried the Google sample dataflow but I get the following error when I run maven install as described in the following link:
[ERROR] Failed to execute goal on project
google-cloud-dataflow-java-examples-all: Could not resolve
dependencies for project
com.google.cloud.dataflow:google-cloud-dataflow-java-examples-all:jar:manual_build:
Could not find artifact
com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:jar:tests:manual_build
in central (http://repo.maven.apache.org/maven2) -> [Help 1] [ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch. [ERROR] Re-run Maven using the -X switch to enable full
debug logging. [ERROR] [ERROR] For more information about the errors
and possible solutions, please read the following articles: [ERROR]
[Help 1]
In fact I did mvn clean install and always get the error. It seams that the jar google-cloud-dataflow-java-sdk cannot be build.

Trying to use Play Framework

Not sure how to describe this error, but I'll try. I'm trying to learn to use the Play Framework for a project I'm collaborating on, and a few hours into but having trouble.
After creating a new project with activator, entering the directory and then typing activator, I then type "play" and get this output:
➜ ix activator
[info] Loading project definition from /Users/ace/Projects/ix/project
[info] Updating {file:/Users/ace/Projects/ix/project/}ix-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to ix (in build file:/Users/ace/Projects/ix/)
[ix] $ play
[error] Not a valid command: play (similar: apply, last, alias)
[error] Not a valid project ID: play
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: play (similar: playStop, playConf, play-stop)
[error] play
[error]
I can't make any sense of it. Literally just installed everything today (Scala/Play Framework) and using it on OSX 10.10.
You have to use the "activator" command instead of "play". This has been the case since version 2.3:
The first thing you’ll notice about Play 2.3 is that the play command
has become the activator command. Play has been updated to use
Activator...

Just downloaded the Scala Lift chat application and use the instructions to run it, but it fails

I cloned the project from:
https://github.com/dpp/simply_lift.git
Then I followed the instructions which state:
Change directories into the chat directory and type sbt update ~jetty-run.
SBT fetches dependencies, and then I get this:
[error] Not a valid command: jetty-run
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: jetty-run (similar: run)
[error] jetty-run
[error]
Now what?
In versions of SBT newer than 0.10.0, ~jetty-run has been removed in favour of:
container:start
container:stop
deployment // compiles the changes made while jetty is running.
You should've used sbt from the packaged archive (./sbt). Instead of a system-wide SBT (which may be new).
Anyway, I suggest to use use the new SBT and everything new, too. This is the official and good starting point for a project: https://github.com/lift/lift_25_sbt/
(personally I use it and I'm cool with how it works)