简体   繁体   中英

Use Play Framework library in an existing Scala Project

I'm currently working on a Scala project, recently, I want to include some Play framework features to my project. As I'm using sbt , I change my build.sbt to:

import play.Project._

name := "deploymentmanager"

version := "1.0"

scalaVersion := "2.10.3"

playScalaSettings

project.sbt is also updated:

// The Typesafe repository 
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")

With those changes, I manage to build my project with Play's feature in it. However, when I'm writing code in Eclipse, all Play's features are marked as error: not found, object play . I wonder if there is any way to make Eclipse aware of Play library using sbt.

Try adding the Eclipse sbt plugin. https://github.com/typesafehub/sbteclipse

And then do a >eclipse from the command line to regenerate the Eclipse specific files and import/reload that project in Eclipse.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM