If you make any important changes to your application, such as changing the classpath, use eclipse again to regenerate the configuration files. If you use normal run then you have to hit Refresh on your browser each time. This way scala template files are auto discovered when you create a new template in view and auto compiled when the file changes. Tip: You can run your application using ~run to enable direct compilation on file change. Stopping the debugging session will not stop the server. From now on you can click on Debug to connect to the running application. In the Debug Configurations dialog, right-click on Remote Java Application and select New. To debug, start your application with sbt -jvm-debug 9999 run and in Eclipse right-click on the project and select Debug As, Debug Configurations. You then need to import the application into your Workspace with the File/Import/General/Existing project… menu (compile your project first). Or from the sbt shell, type: $ eclipse skip-parents=false Note: if you are using sub-projects with aggregate, you would need to set skipParents appropriately in build.sbt: EclipseKeys.skipParents in ThisBuild := false If you want to grab the available source jars (this will take longer and it’s possible a few sources might be missing): $ eclipse with-source=true scala files for views and routesĮclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) §Generate configurationĪfter configuring sbt-eclipse, to transform a Play application into a working Eclipse project, use the eclipse command: $ eclipse Don't expect Scala IDEĮclipseKeys.projectFlavor := EclipseProjectFlavor.Java
If you do not want to install Scala IDE and have only Java sources in your project, then you can set the following build.sbt (assuming you have no Scala sources): // Java project. If you have Scala sources in your project, you will need to install Scala IDE. class files for views and routes are presentĮclipseKeys.preTasks := Seq(compile in Compile, compile in Test) You can force compilation to happen when the eclipse command runs by adding the following setting in build.sbt: // Compile the project before generating Eclipse files, so You must compile your project before running the eclipse command.
Make sure to always use the most recent available version in your project/plugins.sbt file or follow sbteclipse docs to install globally. Integration with Eclipse requires sbteclipse. However, using a modern Java or Scala IDE provides cool productivity features like auto-completion, on-the-fly compilation, assisted refactoring and debugging. You don’t even need a sophisticated IDE, because Play compiles and refreshes the modifications you make to your source files automatically, so you can easily work using a simple text editor.
English ▾ English българин Français 日本語 Türkçe Getting started