在eclipse中为Play框架设置sbteclipse

时间:2022-08-29 22:19:04

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

我是Play框架的新手。我跟着这个链接,安装成功,但现在我想在eclipse上集成项目。我从游戏中查看官方链接,但我不明白在哪里写

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

and other steps.

和其他步骤。

I am using Mac Os X and Eclipse Luna.

我正在使用Mac Os X和Eclipse Luna。

1 个解决方案

#1


3  

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

您需要在“project \ plugins.sbt”文件中编写它:

在eclipse中为Play框架设置sbteclipse

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:

顺便说一句,如果你打算只使用java(我从标签中看到),那么你也可以将这些行添加到“build.sbt”文件中:

// 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

UPDATE

@mkruz gave a good advice as well:

@mkruz也提出了一个很好的建议:

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

使用文本编辑器并修改project / plugins.sbt和build.sbt,如上所述,然后运行activator eclipse或sbt eclipse。然后,您应该能够通过File - > Import - > Existing Projects导入到Eclipse中的项目到Workspace中

#1


3  

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

您需要在“project \ plugins.sbt”文件中编写它:

在eclipse中为Play框架设置sbteclipse

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:

顺便说一句,如果你打算只使用java(我从标签中看到),那么你也可以将这些行添加到“build.sbt”文件中:

// 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

UPDATE

@mkruz gave a good advice as well:

@mkruz也提出了一个很好的建议:

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

使用文本编辑器并修改project / plugins.sbt和build.sbt,如上所述,然后运行activator eclipse或sbt eclipse。然后,您应该能够通过File - > Import - > Existing Projects导入到Eclipse中的项目到Workspace中