Has anyone integrated Play with MapStruct

104 views
Skip to first unread message

raunak

unread,
Dec 3, 2015, 12:16:11 PM12/3/15
to play-framework
Main challenge I face is declaring the build process as described on MapStruct's documentation. Declaring the dependency in SBT is straight forward, however, i'm having issues integrating the maven build process into sbt. Any help is greatly appreciated. 


Igmar Palsenberg

unread,
Dec 3, 2015, 1:31:16 PM12/3/15
to play-framework


Op donderdag 3 december 2015 18:16:11 UTC+1 schreef raunak:
Main challenge I face is declaring the build process as described on MapStruct's documentation. Declaring the dependency in SBT is straight forward, however, i'm having issues integrating the maven build process into sbt. Any help is greatly appreciated. 

It uses SBT, not maven. It's not that easy I think : It's a preprocessor, and it looks like it requires use of javac. You might want to look at the DI section, that might give some pointers in wiring it up.


Igmar 

raunak

unread,
Dec 3, 2015, 9:55:56 PM12/3/15
to play-framework
Thanks Igmar for your suggestion. Turns out, it was pretty straight forward! 
I included the 'mapstruct-processor' as a dependency in build.sbt, and SBT took care of the build automagically.

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  "org.mapstruct" % "mapstruct-jdk8" % "1.0.0.Final",
  "org.mapstruct" % "mapstruct-processor" % "1.0.0.Final"
)

Igmar Palsenberg

unread,
Dec 4, 2015, 2:17:11 AM12/4/15
to play-framework
 
Thanks Igmar for your suggestion. Turns out, it was pretty straight forward! 
I included the 'mapstruct-processor' as a dependency in build.sbt, and SBT took care of the build automagically.

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  "org.mapstruct" % "mapstruct-jdk8" % "1.0.0.Final",
  "org.mapstruct" % "mapstruct-processor" % "1.0.0.Final"
)

Simple after all, I like that. Nice to see it works :)


Igmar 
Reply all
Reply to author
Forward
0 new messages