4

Using twirl for generating template class. Everything is working fine with sbt and the webpages are rendering.

I am using Scala-IDE for development. And in the Scala-IDE the reference to the template class i.e. "html.test()", test is the template name, is showing as an error.

This is the error:

Description Resource Path Location Type

missing or invalid dependency detected while loading class file 'test.class'. Could not access term api in value .twirl, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'test.class' was compiled against an incompatible version of .twirl. ApiService.scala /api/src/main/scala/com/komma/api/rest line 97 Scala Problem.

I did a clean and it is giving "not found: value html" error now.

Is there any way to resolve this error in the scala IDE ?

Thanks.

Biswanath
  • 8,877
  • 12
  • 41
  • 57

2 Answers2

0

Re-running sbt eclipse added target/scala-2.11/twirl/main as a source folder which resolved the compilation errors for me.

alalonde
  • 1,623
  • 1
  • 14
  • 27
0

For my twirl configuration, sbt eclipse did not add the twirl output directory as a source folder. Adding target/scala-2.11/twirl/main to the eclipse project build path through the Add Folder button, under Java Build Path, by hand, was my solution.

matanster
  • 13,785
  • 14
  • 75
  • 135