<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Apply lombok for Ivy project</title><link>https://answers.axonivy.com/questions/2908/apply-lombok-for-ivy-project</link><description>&lt;p&gt;Hello Ivy Team,
As you know, lombok is using for reducing boilerplate code.
But applying for Ivy project is quite very difficult:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For the designer, it works perfectly (configuration likes eclipse)&lt;/li&gt;
&lt;li&gt;For maven build (using Axon.ivy Project Build Plugin), it doesn't work except I do a work-arround by using delombok plugin (&lt;a href="https://projectlombok.org/features/delombok)"&gt;https://projectlombok.org/features/delombok)&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;But it's very annoying in declaration of pom file and building process:&lt;/li&gt;
&lt;li&gt;For details, in maven build process, it has to do:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;
    1. backup src folder to src_temp folder.
    2. delombok src (some lombok java classes are delomboked --&amp;gt; they are using for compilation)
    3. After compilation, restore 'src_temp' folder to src folder (for reverting the original source code)
    --&amp;gt; if the exception occurs (for ex: compile error) --&amp;gt; step 3 is NOT executed --&amp;gt; So, I have to restore manually by myself (It's very annoying if build exception occurs frequently)
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;plugin&amp;gt;
    &amp;lt;groupid&amp;gt;org.projectlombok&amp;lt;/groupid&amp;gt;
    &amp;lt;artifactid&amp;gt;lombok-maven-plugin&amp;lt;/artifactid&amp;gt;
    &amp;lt;executions&amp;gt;
        &amp;lt;execution&amp;gt;
            &amp;lt;id&amp;gt;lombok-code&amp;lt;/id&amp;gt;
            &amp;lt;phase&amp;gt;generate-sources&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
                &amp;lt;goal&amp;gt;delombok&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
            &amp;lt;configuration&amp;gt;
                &amp;lt;encoding&amp;gt;UTF-8&amp;lt;/encoding&amp;gt;
                &amp;lt;sourcedirectory&amp;gt;src&amp;lt;/sourcedirectory&amp;gt;
                &amp;lt;addoutputdirectory&amp;gt;false&amp;lt;/addoutputdirectory&amp;gt;
            &amp;lt;/configuration&amp;gt;
        &amp;lt;/execution&amp;gt;
    &amp;lt;/executions&amp;gt;
&amp;lt;/plugin&amp;gt;
&amp;lt;plugin&amp;gt;
    &amp;lt;artifactid&amp;gt;maven-resources-plugin&amp;lt;/artifactid&amp;gt;
    &amp;lt;executions&amp;gt;
        &amp;lt;execution&amp;gt;
            &amp;lt;id&amp;gt;copy-src-to-src_temp&amp;lt;/id&amp;gt;
            &amp;lt;phase&amp;gt;validate&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
                &amp;lt;goal&amp;gt;copy-resources&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
            &amp;lt;configuration&amp;gt;
                &amp;lt;overwrite&amp;gt;true&amp;lt;/overwrite&amp;gt;
                &amp;lt;outputdirectory&amp;gt;target/src_temp&amp;lt;/outputdirectory&amp;gt;
                &amp;lt;encoding&amp;gt;UTF-8&amp;lt;/encoding&amp;gt;
                &amp;lt;resources&amp;gt;
                    &amp;lt;resource&amp;gt;
                        &amp;lt;directory&amp;gt;src&amp;lt;/directory&amp;gt;
                        &amp;lt;include&amp;gt;&lt;strong&gt;/*.java&amp;lt;/include&amp;gt;
                    &amp;lt;/resource&amp;gt;
                &amp;lt;/resources&amp;gt;
            &amp;lt;/configuration&amp;gt;
        &amp;lt;/execution&amp;gt;
        &amp;lt;execution&amp;gt;
            &amp;lt;id&amp;gt;copy-delombok-source-to-src&amp;lt;/id&amp;gt;
            &amp;lt;phase&amp;gt;process-sources&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
                &amp;lt;goal&amp;gt;copy-resources&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
            &amp;lt;configuration&amp;gt;
                &amp;lt;overwrite&amp;gt;true&amp;lt;/overwrite&amp;gt;
                &amp;lt;outputdirectory&amp;gt;src&amp;lt;/outputdirectory&amp;gt;
                &amp;lt;encoding&amp;gt;UTF-8&amp;lt;/encoding&amp;gt;
                &amp;lt;resources&amp;gt;
                    &amp;lt;resource&amp;gt;
                        &amp;lt;directory&amp;gt;target/generated-sources/delombok&amp;lt;/directory&amp;gt;
                        &amp;lt;include&amp;gt;&lt;/strong&gt;/&lt;em&gt;.java&amp;lt;/include&amp;gt;
                    &amp;lt;/resource&amp;gt;
                &amp;lt;/resources&amp;gt;
            &amp;lt;/configuration&amp;gt;
        &amp;lt;/execution&amp;gt;
        &amp;lt;execution&amp;gt;
            &amp;lt;id&amp;gt;copy-src_temp-to-src-install-phase&amp;lt;/id&amp;gt;
            &amp;lt;phase&amp;gt;install&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
                &amp;lt;goal&amp;gt;copy-resources&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
            &amp;lt;configuration&amp;gt;
                &amp;lt;overwrite&amp;gt;true&amp;lt;/overwrite&amp;gt;
                &amp;lt;outputdirectory&amp;gt;src&amp;lt;/outputdirectory&amp;gt;
                &amp;lt;encoding&amp;gt;UTF-8&amp;lt;/encoding&amp;gt;
                &amp;lt;resources&amp;gt;
                    &amp;lt;resource&amp;gt;
                        &amp;lt;directory&amp;gt;target/src_temp&amp;lt;/directory&amp;gt;
                        &amp;lt;include&amp;gt;&lt;/em&gt;&lt;em&gt;/&lt;/em&gt;.java&amp;lt;/include&amp;gt;
                    &amp;lt;/resource&amp;gt;
                &amp;lt;/resources&amp;gt;
            &amp;lt;/configuration&amp;gt;
        &amp;lt;/execution&amp;gt;
    &amp;lt;/executions&amp;gt;
&amp;lt;/plugin&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;

&lt;p&gt;If you have other idea or other way for configuration, pls let me know!&lt;/p&gt;
&lt;p&gt;Many thanks!
Hap Em,&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2908/apply-lombok-for-ivy-project" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 11 Oct 2017 06:40:05 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2908/apply-lombok-for-ivy-project/2909</link><description>&lt;p&gt;What I know is that from the ivy.core there has been some investigation in making the  &lt;code&gt;project-build-plugin&lt;/code&gt; able to compile with lombok. &lt;a href="https://jira.axonivy.com/jira/browse/XIVY-1606"&gt;https://jira.axonivy.com/jira/browse/XIVY-1606&lt;/a&gt; But that approach failed. 
Roughly concluded lombok is very cool for the user, but the integration into eclipse and other tools has been done very dirty. And its not easy to apply them anywhere else...&lt;/p&gt;
&lt;p&gt;In my opinion there is also no big need to use lombok in ivy projects. Yes you have some extra features such as builders for your pojos. But we already provide a simple way to define POJOs via DataClasses. As with lombok you have an easy Editor to define classes and its properties. And you have the same drawbacks such as very weak refactoring support...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Wed, 11 Oct 2017 06:40:05 -0400</pubDate><guid>https://answers.axonivy.com/questions/2908/apply-lombok-for-ivy-project/2909</guid></item></channel></rss>