gradle-lombok plugin is not working in a single project
<p>I am struggling with a simple gradle build script to add the <a href="https://projectlombok.org" rel="nofollow">Lombok Project</a> features on my project (generate accessors methods) through <a href="https://github.com/franzbecker/gradle-lombok" rel="nofollow">gradle-lombok plugin</a>. Using gradle I can't build it via command-line, it's failing to compile. I created <a href="https://github.com/wbsouza/lombok-demo-failing" rel="nofollow">this small project</a> as a proof of concept to show that it does not working. See bellow my script and the classes not compiling. </p>

<p>After that I recreated the <a href="https://github.com/wbsouza/lombok-demo-subprojects" rel="nofollow">project with sub-projects structure</a> and the most weird thing is just doing this separation made it work, but I am still looking for why the single project does not work.</p>

<p>If someone can give a hint will be very welcomed.</p>

<pre class="lang-java prettyprint-override"><code>buildscript {
    repositories {
        jcenter()
        mavenLocal()
        maven { url "https://repo.spring.io/plugins-release" }
        maven { url "https://plugins.gradle.org/m2" }
    }
    dependencies {
        classpath "io.franzbecker:gradle-lombok:1.7"
    }
}

plugins {
    id "io.franzbecker.gradle-lombok" version "1.7"
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "io.franzbecker.gradle-lombok"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'lombok-demo'
version = '1.0-SNAPSHOT'
buildDir = 'target'

// global configurations
configurations {
    compile {
        exclude(module: 'commons-logging')
        exclude(module: 'c3p0')
        exclude(module: 'log4j')
        exclude(module: 'log4j2')
        exclude(module: 'opensaml')
    }
}


repositories {
    mavenLocal()
    mavenCentral()
    maven { url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/" }
    maven { url "http://jasperreports.sourceforge.net/maven2/"}
}


dependencies {
    compile "com.google.guava:guava:${version_guava}"
    compile "org.projectlombok:lombok:1.16.10"
    compile "org.slf4j:slf4j-api:${version_slf4j}"

    compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: '1.0.0.Final'

    compile "javax.validation:validation-api:${version_javax_validation}"
    compile ("org.hibernate:hibernate-validator:${version_hibernate_validator}") {
        exclude(module: "classmate")
    }

    compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.3.0'

    compile "org.hsqldb:hsqldb:${version_hsqldb}"
    //provided "org.hsqldb:hsqldb:${version_hsqldb}"

}


tasks.withType( JavaCompile.class ).all { task -&gt;
    task.options.encoding = "UTF-8"
    task.options.compilerArgs += ["-nowarn", "-proc:none", "-encoding", "UTF-8", "-source", sourceCompatibility, "-target", targetCompatibility    ]
}
</code></pre>

<pre class="lang-java prettyprint-override"><code>@Data
@Entity
public class Invoice {

    private Long id;
    private String invoiceNumber;
    private LocalDateTime issueDate;
    private Customer customer;
    private LocalDateTime startDate;
    private LocalDateTime endDate;
    private Address billingAddress;
    private List&lt;InvoiceItem&gt; items;

    public Invoice() {
        this.issueDate = LocalDateTime.now();
        this.billingAddress = customer.getMailingAddress();
        this.items = new ArrayList&lt;&gt;();
    }

    public Invoice(Customer customer) {
        this();
        this.customer = customer;
    }

}
</code></pre>

<pre class="lang-java prettyprint-override"><code>import lombok.Data;

import lombokdemo.domain.Address;
import lombokdemo.domain.Customer;
import lombokdemo.domain.Invoice;

import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;


@Data
public class Header {

    private final DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");

    private String companyName;
    private Address companyAddress;
    private URL companyLogo;

    private Invoice invoice;
    private Customer customer;
    private LocalDateTime issueDate;
    private LocalDateTime startDate;
    private LocalDateTime endDate;
    private Address billingAddress;

    public Header(Invoice invoice) {
        this.invoice = invoice;
        this.issueDate = LocalDateTime.now();
        this.companyName = "";
        this.companyAddress = new Address();
    }

    public String getInvoiceNumber() {
        return invoice.getInvoiceNumber();
    }


    public String getIssueDateText() { return dateFormat.format(issueDate); }

    public String getPeriod() {
        return dateFormat.format(startDate) + " to " + dateFormat.format(endDate);
    }

    public String getCustomerName() {
        return invoice.getCustomer().getName();
    }

    private String getAddressText(Address address, boolean includingWeb) {
        StringBuilder sb = new StringBuilder();
        sb.append(address.getStreet1());
        if (!address.getStreet2().isEmpty()) {
            sb.append("\n").append(address.getStreet2());
        }
        if (sb.length() &gt; 0) {
            sb.append("\n");
        }
        if (address.getCity() != null &amp;&amp; !address.getCity().isEmpty()) {
            sb.append(address.getCity());
            if (!address.getStateOrProvince().isEmpty()) {
                sb.append(", ").append(address.getStateOrProvince());
            }
            if (!address.getPostalCode().isEmpty()) {
                sb.append("  ").append(address.getPostalCode());
            }
            sb.append("\n");
        }
        if (address.getCountry() != null &amp;&amp; !address.getCountry().isEmpty()) {
            sb.append(address.getCountry());
            sb.append("\n");
        }
        if (includingWeb) {
            if (!address.getWebsite().isEmpty()) {
                sb.append(address.getWebsite());
                sb.append("\n");
            }
            if (!address.getEmail().isEmpty()) {
                sb.append(address.getEmail());
                sb.append("\n");
            }
        }
        return sb.toString();
    }

    public String getCompanyAddress() {
        final StringBuilder sb = new StringBuilder();
        if (!companyAddress.getContactName().isEmpty()) {
            sb.append(companyAddress.getContactName());
        }
        sb.append(companyAddress.getStreet1());
        if (!companyAddress.getStreet2().isEmpty()) {
            sb.append("\n").append(companyAddress.getStreet2());
        }
        sb.append("\n");
        sb.append(getAddressText(companyAddress, true));
        return sb.toString();
    }

    public String getBillingAddress() {
        final Address address = invoice.getCustomer().getMailingAddress();
        final StringBuilder sb = new StringBuilder();
        if (!address.getContactName().isEmpty()) {
            sb.append(address.getContactName());
        }
        sb.append(getAddressText(address, false));
        return sb.toString();
    }
}
</code></pre>