简体   繁体   中英

Eclipse Classpath with Play Framework

I'm trying to run a small Play application (well, the tests really) in Eclipse and I've come up against a frustrating problem. When I run the command from the command line all the tests are successful, but from Eclipse I've found that it is unable to load some of our required properties files. Looking at the target directory I see two compiled class folders, classes and classes_managed . The properties files are in the classes directory, as I'd expect, but when I look to the class that's attempting to load the properties file the classpath appears to only have the classes_managed directory, which doesn't contain the properties files that are required.

For reference I am running these as JUnit tests so that I can debug them. I've run play eclipse on the command line and imported the project to Eclipse as suggested in the documentation. I'm using Eclipse Kepler and Play 2.2.3.

Any help would be appreciated.

If those files are not getting added to the classpath properly, you can ensure they're accessible by specifically telling sbt that they need to be on the classpath with:

unmanagedClasspath in Test <+= baseDirectory map { bd => Attributed.blank(bd / "conf") }

put this line somewhere in your build.sbt file

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