13

I am new to play framework and trying to run securesocial as in https://github.com/jaliss/securesocial Using Play 2.3, Scala 2.10.0

.sbt file is configured as

name := "SecureSocial-parent"

version := Common.version

scalaVersion := Common.scalaVersion

lazy val core =  project.in( file("module-code") ).enablePlugins(PlayScala)

lazy val scalaDemo = project.in( file("samples/scala/demo") ).enablePlugins(PlayScala).dependsOn(core)

lazy val javaDemo = project.in( file("samples/java/demo") ).enablePlugins(PlayJava).dependsOn(core)

lazy val root = project.in( file(".") ).aggregate(core, scalaDemo, javaDemo) .settings(
     aggregate in update := false
   )

But getting below error

~\securesocial-master>activator run
[info] Loading project definition from ~\securesocial-master\project
[info] Set current project to SecureSocial-parent (in build file:~/securesocial-master/)
java.lang.RuntimeException: No main class detected.
        at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last securesocial-master/compile:run for the full output.
[error] (securesocial-master/compile:run) No main class detected.

The project compiled successfully with many warnings on deprecated API Any pointer will be useful on how to resolve the no main class error

ad-inf
  • 1,520
  • 4
  • 30
  • 53

2 Answers2

8

As far as I understand it, SecureSocial-parent is just the library - it can be compiled, but cannot be run per se. You can only run the demo projects. For example, if you start activator in the securesocial directory, you can type

project javaDemo

to switch to the Java demo project and then

~run

to run it.

vektor
  • 3,312
  • 8
  • 41
  • 71
6

Just had the same problem. I am using the scala version though. I am running the sample app directly from the samples/scala/demo folder (by typing activator in the terminal).

The key to get it up and running was to add the following line to scalaDemo.sbt

lazy val root = (project in file(".")).enablePlugins(PlayScala)

which should probably be

lazy val root = (project in file(".")).enablePlugins(PlayJava)

into the javaDemo.sbt file, since you are running the Java version.

I can see when the app starts that I have problems loading some gifs in the public folder, so maybe it is a wrong approach.