Play 2.6 & Scala 2.12.1 - sbt new playframework/play-scala-seed.g8

2,076 views
Skip to first unread message

NOTiFY

unread,
Mar 6, 2017, 6:16:16 AM3/6/17
to Play Framework
I've created a new project from the command line using:

sbt new playframework/play-scala-seed.g8

Specifying Scala 2.12 and Play 2.6 using SBT 0.13.13

The plugins.sbt says:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.0")

However, when I try and build the project from the command line I see the log refer to Scala 2.10. Though I can find no reference to it in the project files:



The build finally fails with:

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] ::          UNRESOLVED DEPENDENCIES         ::

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] :: com.typesafe.play#sbt-plugin;2.6.0: not found

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn

[warn] Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.

[warn] com.typesafe.play:sbt-plugin:2.6.0 (scalaVersion=2.10, sbtVersion=0.13)

[warn

[warn] Note: Unresolved dependencies path:

[warn] com.typesafe.play:sbt-plugin:2.6.0 (scalaVersion=2.10, sbtVersion=0.13) (/Users/NOTiFY/IdeaProjects/bewherewhen/project/plugins.sbt#L2-3)

[warn]   +- default:bewherewhen-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)

sbt.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.6.0: not found


Can anyone explain why?

Thanks

Will Sargent

unread,
Mar 6, 2017, 2:18:18 PM3/6/17
to play-fr...@googlegroups.com
Hi -- Play 2.6.0 isn't out yet, so this shouldn't work at all.  The latest release is 2.5.12, which should work with Scala version 2.11.8

Last login: Mon Mar  6 07:20:16 on ttys002
 ~  sbt new playframework/play-scala-seed.g8

[info] Loading global plugins from /Users/wsargent/.sbt/0.13/plugins
[info] Set current project to wsargent (in build file:/Users/wsargent/)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

This template generates a Play Scala project

name [play-scala-seed]:
organization [com.example]:
scala_version [2.11.8]:
scalatestplusplay_version [1.5.1]:
play_version [2.5.12]:

Template applied in ./play-scala-seed

If the log refers to 2.10, you may have the scalaVersion setting commented out -- you must have the following line in build.sbt:

scalaVersion := "2.11.8"



--
Will Sargent
Engineer, Lightbend, Inc.


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/542df72c-fbe1-45dd-8999-dd67c5ad01de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

NOTiFY

unread,
Mar 6, 2017, 2:37:32 PM3/6/17
to Play Framework
I assumed that as there was an announcement that 2.6.0-M was out and there and docs for 2.6 I could at least work with the milestone release.

My build.sbt has:

scalaVersion := "2.12.1"

I even tried specifying its location to:

scalaHome := Some(file(“/usr/local/Cellar/scala”))

I'll give it a go with the older version of Scala.

Must say after using Struts, Spring, SEAM, JSF etc with Java for past 20 years and finding the Play framework a bit a "challenge" .... 
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

NOTiFY

unread,
Mar 6, 2017, 3:11:42 PM3/6/17
to Play Framework
That worked fine from console. However when I try and import the project into IntelliJ I get:

Unsupported major.minor version 52.0

[info] Loading project definition from /Users/NOTiFY/IdeaProjects/bewherewhen/project
[info] Set current project to BeWhereWhen (in build file:/Users/NOTiFY/IdeaProjects/bewherewhen/)
java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:559)
at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:559)
at scala.Option.fold(Option.scala:157)
at com.typesafe.sbt.web.SbtWeb$.com$typesafe$sbt$web$SbtWeb$$load(SbtWeb.scala:573)
at com.typesafe.sbt.web.SbtWeb$$anonfun$globalSettings$1$$anonfun$apply$1.apply(SbtWeb.scala:143)
at com.typesafe.sbt.web.SbtWeb$$anonfun$globalSettings$1$$anonfun$apply$1.apply(SbtWeb.scala:143)
at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:55)
at sbt.Project$.setProject(Project.scala:341)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:507)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:488)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:488)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
at sbt.Command$.process(Command.scala:93)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:96)
at sbt.MainLoop$.run(MainLoop.scala:89)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
at sbt.MainLoop$.runLogged(MainLoop.scala:22)
at sbt.StandardMain$.runManaged(Main.scala:57)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
[error] Use 'last' for the full log.
Invalid response.

Greg Methvin

unread,
Mar 6, 2017, 5:21:10 PM3/6/17
to play-framework
Play requires Java 8. It looks like you're using an older Java version.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/9619ac71-ca35-425d-92d2-b8b195b13c4b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

Greg Methvin

unread,
Mar 6, 2017, 5:21:14 PM3/6/17
to play-framework


On Mon, Mar 6, 2017 at 11:37 AM, NOTiFY <roge...@notify.co.uk> wrote:
I assumed that as there was an announcement that 2.6.0-M was out and there and docs for 2.6 I could at least work with the milestone release.\

You can, you just need to use the version number 2.6.0-M1.

My build.sbt has:

scalaVersion := "2.12.1"

I even tried specifying its location to:

scalaHome := Some(file(“/usr/local/Cellar/scala”))

I'll give it a go with the older version of Scala.

Must say after using Struts, Spring, SEAM, JSF etc with Java for past 20 years and finding the Play framework a bit a "challenge" .... 

Spring and other Java libraries also have milestone versions, and the artifacts are published under a different version number than the final version just like Play.

If there are other things you're having trouble with we're happy to answer those questions. Just make sure you make it clear what you're trying to do so we can provide the best answer up front.


On Monday, 6 March 2017 19:18:18 UTC, Will Sargent wrote:
Hi -- Play 2.6.0 isn't out yet, so this shouldn't work at all.  The latest release is 2.5.12, which should work with Scala version 2.11.8

Last login: Mon Mar  6 07:20:16 on ttys002
 ~  sbt new playframework/play-scala-seed.g8

[info] Loading global plugins from /Users/wsargent/.sbt/0.13/plugins
[info] Set current project to wsargent (in build file:/Users/wsargent/)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation

This template generates a Play Scala project

name [play-scala-seed]:
organization [com.example]:
scala_version [2.11.8]:
scalatestplusplay_version [1.5.1]:
play_version [2.5.12]:

Template applied in ./play-scala-seed

If the log refers to 2.10, you may have the scalaVersion setting commented out -- you must have the following line in build.sbt:

Actually in the log you showed, scala 2.10 is for the SBT plugin, which is what helps you configure your Play build. The current version of SBT uses 2.10, so the Play SBT plugin also uses 2.10. This has no bearing on which scala version the actual Play libraries and your application are using.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/c238c3a9-3e15-45c2-85e5-d472cc9c2fd3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

NOTiFY

unread,
Mar 6, 2017, 5:35:01 PM3/6/17
to Play Framework
No. I'm using Java 8:

MacBook-Pro:bewherewhen NOTiFY$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Will Sargent

unread,
Mar 6, 2017, 5:39:17 PM3/6/17
to play-fr...@googlegroups.com
If you are using JDK 1.8 but have previously built with JDK 1.7, you may need to do a "clean" to remove the class files created before.

Also, try adding the following to build.sbt to double check you're really using 1.8:

 initialize := {
   val _ = initialize.value
   if (sys.props("java.specification.version") != "1.8")
     sys.error("Java 8 is required for this project.")
 }
 

--
Will Sargent
Engineer, Lightbend, Inc.


To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b31b0718-c359-423e-b28c-a76ec2b025a0%40googlegroups.com.

NOTiFY

unread,
Mar 6, 2017, 6:12:47 PM3/6/17
to Play Framework
Will & Greg, many thanks for your help.

Progressing now ...

However, which version of ScalaTest should I use with Scala 2.12.1 and Play 2.6.0-M1?

Get this error with:

libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test


[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] ::          UNRESOLVED DEPENDENCIES         ::

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] :: org.scalatestplus.play#scalatestplus-play_2.12;1.5.1: not found

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn

[warn] Note: Unresolved dependencies path:

[warn] org.scalatestplus.play:scalatestplus-play_2.12:1.5.1 (/Users/NOTiFY/IdeaProjects/bewherewhen/build.sbt#L11-12)

[warn]   +- com.bewherewhen:bewherewhen_2.12:1.0-SNAPSHOT

sbt.ResolveException: unresolved dependency: org.scalatestplus.play#scalatestplus-play_2.12;1.5.1: not found

at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)

at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)

at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)

at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)

at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)

at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)

at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)

at sbt.IvySbt$$anon$4.call(Ivy.scala:65)

at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)

at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)

at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)

at xsbt.boot.Using$.withResource(Using.scala:10)

at xsbt.boot.Using$.apply(Using.scala:9)

at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)

at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)

at xsbt.boot.Locks$.apply0(Locks.scala:31)

at xsbt.boot.Locks$.apply(Locks.scala:28)

at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)

at sbt.IvySbt.withIvy(Ivy.scala:128)

at sbt.IvySbt.withIvy(Ivy.scala:125)

at sbt.IvySbt$Module.withModule(Ivy.scala:156)

at sbt.IvyActions$.updateEither(IvyActions.scala:168)

at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1481)

at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1477)

at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1512)

at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1510)

at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)

at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1515)

at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1509)

at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)

at sbt.Classpaths$.cachedUpdate(Defaults.scala:1532)

at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1459)

at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1411)

at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)

at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)

at sbt.std.Transform$$anon$4.work(System.scala:63)

at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)

at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)

at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)

at sbt.Execute.work(Execute.scala:237)

at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)

at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)

at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)

at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

[error] (*:update) sbt.ResolveException: unresolved dependency: org.scalatestplus.play#scalatestplus-play_2.12;1.5.1: not found

[error] Total time: 49 s, completed 06-Mar-2017 23:04:59 

Will Sargent

unread,
Mar 6, 2017, 6:43:04 PM3/6/17
to play-fr...@googlegroups.com
If you look at the SNAPSHOT branches for the Play projects on Github, they'll show you what's configured for 2.6.0-M1.

So if you look at play-scala-starter-example, the recommended starting project for new users:

You'll see:

libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "2.0.0-M2" % Test


--
Will Sargent
Engineer, Lightbend, Inc.


To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b409afe9-a369-449a-82ac-55bc0535faf5%40googlegroups.com.

Dominik Dorn

unread,
Mar 6, 2017, 7:05:24 PM3/6/17
to play-framework
@Roger: If you are new to the PlayFramework, I strongly suggest you start with 2.5.12 instead of 2.6.0-M1 .. 
There are still many things that need to be fixed before I would safely suggest anyone trying out play/who's new to the framework to go with 2.6.0-M1,
especially as it comes to scala 2.12 support (because still many of the sbt-plugins / scala dependencies haven't released versions for 2.12 yet). 

My honest suggestion: Stick with 2.5.12 till 2.6.0 goes final.
As for your compile issue, make sure that the javac you have in your path is also version 1.8. javac -version should show something like
⇒  javac -version
javac 1.8.0_102 
or higher.

cheers,
dominik


For more options, visit https://groups.google.com/d/optout.



--
Dominik Dorn
http://dominikdorn.com
http://twitter.com/domdorn

Skripten, Mitschriften, Lernunterlagen, etc. findest Du auf http://www.studyguru.eu !

NOTiFY

unread,
Mar 7, 2017, 6:05:54 AM3/7/17
to Play Framework
Thanks for your suggestions have got the "play-scala-seed.g8" running now with Scala 2.12 and Play 2.6.

I prefer, sometimes to my cost, to use the latest of everything, and will persevere with Play 2.6 and that's where I want to end up.


Sure I'll be back !

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages