Home Ask Login Register

Developers Planet

Your answer is one click away!

Nathan February 2016

Seralizing a scala object into a JSON at compile time

I'm looking for way to serialize a defined object into a JSON and place it in the resources directory at compile-time. What's the cleanest way to do this?


dth February 2016

SBT can do stuff like that:


A macro would be an alternative, but setting sbt up to compile macros in two stages, is probably more difficult. Also, this only makes sense if calling such a macro should be part of your application code.

Post Status

Asked in February 2016
Viewed 1,182 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life