3

I am new in Play framework. I followed by this link, installed successfully, but now I want to integrate project on eclipse. I viewed official link from play, but I do not understand where to write

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

and other steps.

I am using Mac Os X and Eclipse Luna.

ucMedia
  • 4,105
  • 4
  • 38
  • 46
Vinit Solanki
  • 1,863
  • 2
  • 15
  • 29
  • I would suggest IntelliJ IDE . and you should check play doc more often. there you can find the solution easier (Scroll the link to the end to see the answer ).https://www.playframework.com/documentation/2.6.x/BuildOverview – Fenici Jul 18 '17 at 14:02
  • thanx for your the reply but question was too back and I moved in Spring Boot, and happy to use Spring boot – Vinit Solanki Jul 18 '17 at 14:04
  • Oh ~ did not realize that , but no much people using play nowadays, the community is not really active – Fenici Jul 18 '17 at 14:07

1 Answers1

5

You need to write it in the "project\plugins.sbt" file:

enter image description here

btw, if you are planning to use only java (as I see from the tag) then you can add this lines to the "build.sbt" file as well:

// Compile the project before generating Eclipse files,
// so that generated .scala or .class files for views and routes are present
EclipseKeys.preTasks := Seq(compile in Compile)

// Java project. Don't expect Scala IDE
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java

// Use .class files instead of generated .scala files for views and routes
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources)

UPDATE

@mkruz gave a good advice as well:

Use a text-editor and modify project/plugins.sbt and build.sbt like described above and then run activator eclipse or sbt eclipse. You should then be able to import the project in Eclipse via File -> Import -> Existing Projects into Workspace

Community
  • 1
  • 1
Andriy Kuba
  • 8,093
  • 2
  • 29
  • 46
  • but how to import play project in eclipse ? – Vinit Solanki Mar 23 '16 at 12:26
  • 1
    Use a text-editor and modify `project/plugins.sbt` and `build.sbt` like described above and then run `activator eclipse` or `sbt eclipse`. You should then be able to import the project in Eclipse via `File` -> `Import` -> `Existing Projects into Workspace`. – mkurz Mar 23 '16 at 12:46
  • Thanks for this, the Play documentation is a little vague on this point but this got me going! – Randall Harleigh Oct 10 '16 at 17:12
  • @ Randall Harleigh Scroll down to the end Its highlighted with large font https://www.playframework.com/documentation/2.6.x/BuildOverview – Fenici Jul 18 '17 at 14:05