Cannot run Play2 module in presence of Common.scala
Hello,
assume the following scenario:
- git clone https://github.com/adrianhurt/play-multidomain-seed.git
- create IDEA project
- choose "admin" or "web" module, try to run as Play2 App
- get the following error:
[info] Loading project definition from C:\dev\play-multidomain-seed\modules\admin\project
C:\dev\play-multidomain-seed\modules\admin\build.sbt:1: error: not found: value Common
Common.serviceSettings("admin", messagesFilesFrom = Seq("common", "admin"))
^
[error] Type error in expression
Play 2 automatically recognises shared settings in project/Common.scala; it seems when IDEA tries to load build.sbt for individual module it does not take that into account.
Or am I missing something?
Please sign in to leave a comment.
I got rid of "Common.scala" and moved common configuration into build.sbt files but I still cannot run a module from IDEA. Modules are running without a problem from sbt, so I reckon Play2 multi module set up is simply not working.
So the question is rather "how to run different Play2 modules in the same project" ?
Found a ticket https://youtrack.jetbrains.com/issue/SCL-11291 that claims that the issue was wixed in 2017.1, I use 2017.2.5
I detected this error in 2017.2.5, but in 2017.3 IDEA EAP with the Scala Plugin 2017.3.4 it ran correctly. If you have a chance, please try it there.
ownloaded and installed the latest EAP, Scala plugin 2017.3.4. Freshly cloned "https://github.com/adrianhurt/play-multidomain-seed.git", still no luck.
Console output:
"C:\Program Files\Java\jdk1.8.0_111\bin\java" -Dfile.encoding=UTF8 -Djline.terminal=none -Dsbt.log.noformat=true -Dsbt.global.base=C:\Users\Pin\AppData\Local\Temp\sbt-global-plugin2stub -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -classpath C:\Users\Pin\.IntelliJIdea2017.3\config\plugins\Scala\launcher\sbt-launch.jar xsbt.boot.Boot "project web" run
Getting org.fusesource.jansi jansi 1.11 ...
:: retrieving :: org.scala-sbt#boot-jansi
confs: [default]
1 artifacts copied, 0 already retrieved (111kB/15ms)
Getting org.scala-sbt sbt 1.0.1 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
69 artifacts copied, 0 already retrieved (21993kB/308ms)
Getting Scala 2.12.3 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (19004kB/52ms)
[info] Updated file C:\dev\play-multidomain-seed\modules\web\project\build.properties: set sbt.version to 1.0.1
[info] Loading project definition from C:\dev\play-multidomain-seed\modules\web\project
[info] Updating {file:/C:/dev/play-multidomain-seed/modules/web/project/}web-build...
[info] Done updating.
C:\dev\play-multidomain-seed\modules\web\build.sbt:1: error: not found: value Common
Common.serviceSettings("web", messagesFilesFrom = Seq("common", "web"))
^
C:\dev\play-multidomain-seed\modules\web\build.sbt:1: error: not found: value messagesFilesFrom
Common.serviceSettings("web", messagesFilesFrom = Seq("common", "web"))
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Process finished with exit code 1
Run configuration:
Any ideas?
I've figure out, that by default, in my case, IDEA creates run_configuration with setting "Play2 Module: root" and launches the project without errors. When the setting is "Play2 Module: web", it gives the error. We'll take a look what happens there.
I have the same error in the 2019.1 version of Intellej Idea. Child project does not visible Common setting object.
[info] Loading project definition from D:\dev\scala\top\modules\api\project
D:\dev\scala\top\modules\api\build.sbt:5: error: not found: value Common
Common.playSettings
^
[error] Type error in expression
I believe I'm also hitting this now