[2.0] template vs java compilation order (Project Lombok generated getters not recognized)

261 views
Skip to first unread message

Josh

unread,
Mar 9, 2012, 12:34:16 AM3/9/12
to play-fr...@googlegroups.com
Hi,

This is a strange problem... I've been using (and loving) project lombok for the last few days and its been working great.

Today I applied some of the javascriptRoute tips from another thread and recompiled, and now I get an error message saying that my lombok-generated getters can't be found. I can't really explain it, I see the getters in Eclipse and I have this in my Build.scala file (in the correct place):

"org.projectlombok" % "lombok" % "0.10.8"

but I get this error:

[error] /Users/jpollak/src/QuickTrans/target/scala-2.9.1/src_managed/main/views/html/key.template.scala:94: value getValue is not a member of models.Translation

I was wondering if it is an order of operations issue between compiling the scala file and Template.java, or if I might be doing something else wrong.

For now, I've manually created a getter to keep working, but I'd like to keep using lombok!

-Josh

Ben McCann

unread,
Mar 9, 2012, 1:36:02 AM3/9/12
to play-fr...@googlegroups.com
For some reason the views get compiled before the models.  I'm not sure how that works at all or whats going on.  I agree it's very strange.  Anyway, my solution was to create a Play sub-project that holds only my models.  That's been allowing me to use Lombok and has worked well.

See "Splitting your web application into several parts" on https://github.com/playframework/Play20/wiki/SBTSubProjects 

-Ben

Josh

unread,
Mar 9, 2012, 11:33:13 AM3/9/12
to play-fr...@googlegroups.com
Alright, I'll check it out. Its unfortunate to have to split the Models out, but at least it is doable.

Matthias Kurz

unread,
Mar 15, 2015, 11:01:59 AM3/15/15
to play-fr...@googlegroups.com
This has nothing to do with compile order within Play or sbt - it's a problem with the Scala compiler - see my comment for further explanation:
Reply all
Reply to author
Forward
0 new messages