Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:55:38+00:00 2026-06-10T01:55:38+00:00

What about Lombok integration with Play Framework 2? I really like Lombok it make

  • 0

What about Lombok integration with Play Framework 2?
I really like Lombok it make my code more readable and less boilerplate. And Play Framework is wonderful too. But there is a great trouble in case if you going to mixup them.

Main reason is that scala temlates in play project compiled before domain classes. So Lombok, which itself is compiler’s hack do not generate accessors for that time.

The question is: if it any ways to make it work?

I found some discussions in Google Groups, but they do not provide any reasonable solution. So have you got any success with it?

And.. why guys from Play Framework project do not provide some Lombok-like solution? Anyway Play is full of code-generation magic and shadow compiling… so, why not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:55:39+00:00Added an answer on June 10, 2026 at 1:55 am

    So, workaround is rather simple and was proposed in google groups, but there are some obscurity in docs, well I’ll describe step-by-step what one should do.

    1. Isolate your domain model logicaly

    This means that domain classes should not call anything from views or controllers.

    2. Create sub-project which contain domain classes

    Some information given here. Sub-project is very similar to default play’s project, and creating it not so hard. I don’t find any tools to do this from play’s console, so you need to create some folders by hand.

    At first create sub-project folder in main project’s folder. Let’s assume you name it domain-data. Next, create required folders like described in standart app. layout. In most cases you want to create simple directory tree in created sub-folder:

    app
     └ models
        └ myclasses
    

    Now move all your domain classes to sub-project’s directory tree.

    3.Configuration

    Configuration will be simple enought. Move to the main project’s project folder and open Build.scala file. This is build script for SBT build system.

    Define some dependencies at first. Add following strings to your build file:

    val domainDependencies = Seq(
        "org.projectlombok" % "lombok" % "0.11.4"
    )
    

    This will add Lombok’s jar to your sub-project. Now create sub-project definition:

    val domainProject = PlayProject(
                                "domain-data", appVersion, domainDependencies, path=file("domain"), mainLang=JAVA
    )
    

    Where path should point to sub-project’s folder.

    And the last step is updating main project configuration for making it depend on sub-project. Dependence will entails sub-project rebuiling on each main project rebuild.

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).dependsOn(domainProject)
    

    After all start main project with play command given in terminal, and type projects command. You should see your new sub-project.

    4. Profit

    Now it is time to safely refactor your existing code using Lombok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

about 10% of the time when I go to compile code that should compile,
I want to use a data class in Lombok. Since it has about a
About 90% of the time, when I click on the Like button on my
About a year ago, a manager in another department brainstormed that I could code
About to start working on a social networking site, but I'd like to incorporate
about the code: tp is a pointer to a certain struct which contains a
About web.py How do I redirrect the output to another output destination like a
About 6 months ago I bought a gallery photo popup code. It came with
About project: I'm trying to write CMS-like web-site on Java. Previously I used PHP
About what I read, the EditorTemplates folder must be located under the Shared folder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.