Eclipse shows errors in setting up Play 2.4

I am trying to configure the Eclipse Scala SDK IDE to work with Play 2.4 on Windows 8. I followed the instructions in the official manual , but after opening the default view index.scala.html, I get a bunch of errors, such as:

  • ambiguous reference to an overloaded definition,

    both methods are displayed in the BaseScalaTemplate class of type (o: Any) (implicit m: Manifest [error]) and the mapping of the method in the BaseScalaTemplate class of type (x: error) map the argument types (play.twirl.api.HtmlFormat.Appendable) and the expected type Any result

    Error in application with default arguments.

    index.scala.html / play- scala -test-app / app / views line 3

    Java issue

  • type Html is not included in the play.api.templates package

    index.scala.html / play- scala -test-app / app / views line

    Java issue

I tried to remove the default import and add a new play.twirl.api._ import to the properties of the Play2 project, but that did not change anything. Is there any way to fix the configuration?

+6
source share
2 answers

I do not know about the first release, but the second is called by the deprecated SbtEclipse plugin. Because of this, target/scala-2.11 subfolders are not added as the source paths to the project. To fix this:

  • bump SbtEclipse plugin version up to 4.0.0: addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
  • run sbt eclipse from the project root directory
  • update the project in Eclipse.
+2
source

see https://groups.google.com/forum/#!topic/scala-ide-user/WFNoQ6GNw1k

1 Fork https://github.com/cweinreben/scala-ide-play2

2 Design a local project

3 Run. /build.sh in the root of the project folder (wait and have a cup of coffee while it loads the Internet)

4 When you finish switching to Eclipse, open the "Install New Software ..." dialog box (Help> Install New Software ... menu)

5 The line of the script creates the update site - so select "Add" in the dialog box, and then "Local ..." and go to the folder "scala -ide-play2 / org.scala-ide. Play2.update-site / target / site "

6 Install the function in this folder

0
source

Source: https://habr.com/ru/post/989086/


All Articles