Lombok not compiling in maven
I am trying to compile my project that uses lombok through maven and i am getting the following issue:
[INFO] ------------------------------------------------------------------------
[INFO] Building akka-calculator-lib 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ akka-calculator-lib ---
[INFO] Deleting C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtarget
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ akka-calculator-lib ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ akka-calculator-lib ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 11 source files to C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtargetclasses
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[13,22] error: variable firstNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[14,22] error: variable secondNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[15,22] error: variable result not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,52] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,87] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[36,54] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[37,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,101] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[44,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[45,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[52,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[53,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[60,60] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[61,80] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,89] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,127] error: cannot find symbol
[INFO] 27 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] akka-parent ........................................ SUCCESS [ 0.164 s]
[INFO] akka-testing ....................................... SUCCESS [ 0.011 s]
[INFO] akka-calculator .................................... SUCCESS [ 0.010 s]
[INFO] akka-calculator-lib ................................ FAILURE [ 2.758 s]
[INFO] akka-calculator-creation ........................... SKIPPED
[INFO] akka-calculator-lookup ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.120 s
[INFO] Finished at: 2016-02-14T19:01:21+01:00
[INFO] Final Memory: 14M/169M
[INFO] ------------------------------------------------------------------------
Where the first error type is for the fields in this class:
package com.mangusbrother.akka.calculator.lib.operation.multiply;
import com.mangusbrother.akka.calculator.lib.operation.MathematicalResult;
import lombok.Data;
/**
* Created by Mangusbrother on 14/02/2016.
*/
@Data
public class MultiplyResult implements MathematicalResult
private static final long serialVersionUID = 738641818941986L;
private final int firstNumber;
private final int secondNumber;
private final int result;
and the second error is when a class tries to access getters from lombok classes
My maven pom.xml has the following in it:
<properties>
<lombok.version>1.16.6</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
java maven lombok
|
show 10 more comments
I am trying to compile my project that uses lombok through maven and i am getting the following issue:
[INFO] ------------------------------------------------------------------------
[INFO] Building akka-calculator-lib 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ akka-calculator-lib ---
[INFO] Deleting C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtarget
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ akka-calculator-lib ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ akka-calculator-lib ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 11 source files to C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtargetclasses
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[13,22] error: variable firstNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[14,22] error: variable secondNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[15,22] error: variable result not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,52] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,87] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[36,54] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[37,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,101] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[44,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[45,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[52,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[53,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[60,60] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[61,80] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,89] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,127] error: cannot find symbol
[INFO] 27 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] akka-parent ........................................ SUCCESS [ 0.164 s]
[INFO] akka-testing ....................................... SUCCESS [ 0.011 s]
[INFO] akka-calculator .................................... SUCCESS [ 0.010 s]
[INFO] akka-calculator-lib ................................ FAILURE [ 2.758 s]
[INFO] akka-calculator-creation ........................... SKIPPED
[INFO] akka-calculator-lookup ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.120 s
[INFO] Finished at: 2016-02-14T19:01:21+01:00
[INFO] Final Memory: 14M/169M
[INFO] ------------------------------------------------------------------------
Where the first error type is for the fields in this class:
package com.mangusbrother.akka.calculator.lib.operation.multiply;
import com.mangusbrother.akka.calculator.lib.operation.MathematicalResult;
import lombok.Data;
/**
* Created by Mangusbrother on 14/02/2016.
*/
@Data
public class MultiplyResult implements MathematicalResult
private static final long serialVersionUID = 738641818941986L;
private final int firstNumber;
private final int secondNumber;
private final int result;
and the second error is when a class tries to access getters from lombok classes
My maven pom.xml has the following in it:
<properties>
<lombok.version>1.16.6</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
java maven lombok
Where are the souces located?src/main/java,src/main/lombok?
– Tunaki
Feb 14 '16 at 17:44
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
It doesn't compile them undersrc/main/lombokso it's not working
– mangusbrother
Feb 14 '16 at 17:55
1
How did you ran Maven? And what's the error? You should runmvn clean package.
– Tunaki
Feb 14 '16 at 17:57
|
show 10 more comments
I am trying to compile my project that uses lombok through maven and i am getting the following issue:
[INFO] ------------------------------------------------------------------------
[INFO] Building akka-calculator-lib 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ akka-calculator-lib ---
[INFO] Deleting C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtarget
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ akka-calculator-lib ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ akka-calculator-lib ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 11 source files to C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtargetclasses
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[13,22] error: variable firstNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[14,22] error: variable secondNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[15,22] error: variable result not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,52] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,87] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[36,54] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[37,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,101] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[44,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[45,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[52,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[53,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[60,60] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[61,80] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,89] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,127] error: cannot find symbol
[INFO] 27 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] akka-parent ........................................ SUCCESS [ 0.164 s]
[INFO] akka-testing ....................................... SUCCESS [ 0.011 s]
[INFO] akka-calculator .................................... SUCCESS [ 0.010 s]
[INFO] akka-calculator-lib ................................ FAILURE [ 2.758 s]
[INFO] akka-calculator-creation ........................... SKIPPED
[INFO] akka-calculator-lookup ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.120 s
[INFO] Finished at: 2016-02-14T19:01:21+01:00
[INFO] Final Memory: 14M/169M
[INFO] ------------------------------------------------------------------------
Where the first error type is for the fields in this class:
package com.mangusbrother.akka.calculator.lib.operation.multiply;
import com.mangusbrother.akka.calculator.lib.operation.MathematicalResult;
import lombok.Data;
/**
* Created by Mangusbrother on 14/02/2016.
*/
@Data
public class MultiplyResult implements MathematicalResult
private static final long serialVersionUID = 738641818941986L;
private final int firstNumber;
private final int secondNumber;
private final int result;
and the second error is when a class tries to access getters from lombok classes
My maven pom.xml has the following in it:
<properties>
<lombok.version>1.16.6</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
java maven lombok
I am trying to compile my project that uses lombok through maven and i am getting the following issue:
[INFO] ------------------------------------------------------------------------
[INFO] Building akka-calculator-lib 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ akka-calculator-lib ---
[INFO] Deleting C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtarget
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ akka-calculator-lib ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ akka-calculator-lib ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 11 source files to C:devprojectsAkkaakka-testingakka-calculatorakka-calculator-libtargetclasses
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[13,22] error: variable firstNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[14,22] error: variable secondNumber not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorliboperationmultiplyMultiplyResult.java:[15,22] error: variable result not initialized in the default constructor
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,52] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[35,87] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[36,54] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[37,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,74] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[38,101] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[43,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[44,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[45,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[46,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[51,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[52,64] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[53,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,84] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[54,111] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,50] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[59,85] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[60,60] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[61,80] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,89] error: cannot find symbol
[ERROR] devprojectsAkkaakka-testingakka-calculatorakka-calculator-libsrcmainjavacommangusbrotherakkacalculatorlibCalculatorActor.java:[62,127] error: cannot find symbol
[INFO] 27 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] akka-parent ........................................ SUCCESS [ 0.164 s]
[INFO] akka-testing ....................................... SUCCESS [ 0.011 s]
[INFO] akka-calculator .................................... SUCCESS [ 0.010 s]
[INFO] akka-calculator-lib ................................ FAILURE [ 2.758 s]
[INFO] akka-calculator-creation ........................... SKIPPED
[INFO] akka-calculator-lookup ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.120 s
[INFO] Finished at: 2016-02-14T19:01:21+01:00
[INFO] Final Memory: 14M/169M
[INFO] ------------------------------------------------------------------------
Where the first error type is for the fields in this class:
package com.mangusbrother.akka.calculator.lib.operation.multiply;
import com.mangusbrother.akka.calculator.lib.operation.MathematicalResult;
import lombok.Data;
/**
* Created by Mangusbrother on 14/02/2016.
*/
@Data
public class MultiplyResult implements MathematicalResult
private static final long serialVersionUID = 738641818941986L;
private final int firstNumber;
private final int secondNumber;
private final int result;
and the second error is when a class tries to access getters from lombok classes
My maven pom.xml has the following in it:
<properties>
<lombok.version>1.16.6</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
java maven lombok
java maven lombok
edited Feb 14 '16 at 18:04
mangusbrother
asked Feb 14 '16 at 17:36
mangusbrothermangusbrother
1,693102959
1,693102959
Where are the souces located?src/main/java,src/main/lombok?
– Tunaki
Feb 14 '16 at 17:44
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
It doesn't compile them undersrc/main/lombokso it's not working
– mangusbrother
Feb 14 '16 at 17:55
1
How did you ran Maven? And what's the error? You should runmvn clean package.
– Tunaki
Feb 14 '16 at 17:57
|
show 10 more comments
Where are the souces located?src/main/java,src/main/lombok?
– Tunaki
Feb 14 '16 at 17:44
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
It doesn't compile them undersrc/main/lombokso it's not working
– mangusbrother
Feb 14 '16 at 17:55
1
How did you ran Maven? And what's the error? You should runmvn clean package.
– Tunaki
Feb 14 '16 at 17:57
Where are the souces located?
src/main/java, src/main/lombok?– Tunaki
Feb 14 '16 at 17:44
Where are the souces located?
src/main/java, src/main/lombok?– Tunaki
Feb 14 '16 at 17:44
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
It doesn't compile them under
src/main/lombok so it's not working– mangusbrother
Feb 14 '16 at 17:55
It doesn't compile them under
src/main/lombok so it's not working– mangusbrother
Feb 14 '16 at 17:55
1
1
How did you ran Maven? And what's the error? You should run
mvn clean package.– Tunaki
Feb 14 '16 at 17:57
How did you ran Maven? And what's the error? You should run
mvn clean package.– Tunaki
Feb 14 '16 at 17:57
|
show 10 more comments
5 Answers
5
active
oldest
votes
I don't know why but you got compiler error because of maven-compiler-plugin. If you can please change plugin version to 3.5 and check if it will work.
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
add a comment |
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>$maven-compiler-plugin.version</version>
<configuration>
<annotationProcessorPaths>
**<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</path>**
</annotationProcessorPaths>
</configuration>
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
add a comment |
I struggled mightily with this and concluded that Lombok 1.16+ and Java 8 are a problem with earlier versions of Maven's compiler plugin. IDEA 2017.1 was building the code without errors, but Maven was throwing 'symbol not found' errors on public methods that were definitely there in a decompiled jar file.
By upgrading to maven-compiler-plugin 3.6.1 across my project and its libraries I was able to get it resolved without having to go down the Delombok path, which I really wanted to avoid.
add a comment |
You will also need to check what version of java is there in path . My issue was with Java 1.8 & 3.5 version . To get it working I had to switch to 1.7 & 3.5 . Please note we are still on 1.7
add a comment |
First you should locate your lombok source (java annotated with lombok) into src/main/lombok and add the lombok-maven-plugin to your project like this:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you don't like to use the lombok-maven-plugin you need to add the following:
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you really like to put your lomboked source into src/main/java instead of the default /src/main/lombok you have to go this way which is not recommended:
<build>
<sourceDirectory>target/generated-sources/delombok</sourceDirectory>
<testSourceDirectory>target/generated-test-sources/delombok</testSourceDirectory>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</build>
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35394885%2flombok-not-compiling-in-maven%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I don't know why but you got compiler error because of maven-compiler-plugin. If you can please change plugin version to 3.5 and check if it will work.
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
add a comment |
I don't know why but you got compiler error because of maven-compiler-plugin. If you can please change plugin version to 3.5 and check if it will work.
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
add a comment |
I don't know why but you got compiler error because of maven-compiler-plugin. If you can please change plugin version to 3.5 and check if it will work.
I don't know why but you got compiler error because of maven-compiler-plugin. If you can please change plugin version to 3.5 and check if it will work.
answered Feb 14 '16 at 18:51
grzesiekwgrzesiekw
34727
34727
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
add a comment |
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
This was the issue. The above given configuration with the compiler plugin upgraded to 3.5.1 will let you use lombok without having to move anything from src/main/java or add extra plugins or inherit external parents
– mangusbrother
Feb 14 '16 at 18:58
add a comment |
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>$maven-compiler-plugin.version</version>
<configuration>
<annotationProcessorPaths>
**<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</path>**
</annotationProcessorPaths>
</configuration>
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
add a comment |
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>$maven-compiler-plugin.version</version>
<configuration>
<annotationProcessorPaths>
**<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</path>**
</annotationProcessorPaths>
</configuration>
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
add a comment |
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>$maven-compiler-plugin.version</version>
<configuration>
<annotationProcessorPaths>
**<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</path>**
</annotationProcessorPaths>
</configuration>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>$maven-compiler-plugin.version</version>
<configuration>
<annotationProcessorPaths>
**<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>$lombok.version</version>
</path>**
</annotationProcessorPaths>
</configuration>
answered May 22 '17 at 15:54
Renato GarciaRenato Garcia
18526
18526
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
add a comment |
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
2
2
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
please put helpful comments about your answer
– EyuelDK
May 22 '17 at 16:00
1
1
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
With maven compiler 3.6.x use "annotationProcessorPaths", works fine.
– Renato Garcia
Aug 25 '17 at 12:38
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Thanks @RenatoGarcia, this was the right answer to me using Java 8 and maven compiler 3.6.2!
– jfneis
May 17 '18 at 19:23
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
Adding lombok path to annotationProcessorPaths worked for me as well
– petre
May 19 '18 at 13:16
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
This should be mark as accepted ans
– Bhargav Patel
Oct 30 '18 at 5:53
add a comment |
I struggled mightily with this and concluded that Lombok 1.16+ and Java 8 are a problem with earlier versions of Maven's compiler plugin. IDEA 2017.1 was building the code without errors, but Maven was throwing 'symbol not found' errors on public methods that were definitely there in a decompiled jar file.
By upgrading to maven-compiler-plugin 3.6.1 across my project and its libraries I was able to get it resolved without having to go down the Delombok path, which I really wanted to avoid.
add a comment |
I struggled mightily with this and concluded that Lombok 1.16+ and Java 8 are a problem with earlier versions of Maven's compiler plugin. IDEA 2017.1 was building the code without errors, but Maven was throwing 'symbol not found' errors on public methods that were definitely there in a decompiled jar file.
By upgrading to maven-compiler-plugin 3.6.1 across my project and its libraries I was able to get it resolved without having to go down the Delombok path, which I really wanted to avoid.
add a comment |
I struggled mightily with this and concluded that Lombok 1.16+ and Java 8 are a problem with earlier versions of Maven's compiler plugin. IDEA 2017.1 was building the code without errors, but Maven was throwing 'symbol not found' errors on public methods that were definitely there in a decompiled jar file.
By upgrading to maven-compiler-plugin 3.6.1 across my project and its libraries I was able to get it resolved without having to go down the Delombok path, which I really wanted to avoid.
I struggled mightily with this and concluded that Lombok 1.16+ and Java 8 are a problem with earlier versions of Maven's compiler plugin. IDEA 2017.1 was building the code without errors, but Maven was throwing 'symbol not found' errors on public methods that were definitely there in a decompiled jar file.
By upgrading to maven-compiler-plugin 3.6.1 across my project and its libraries I was able to get it resolved without having to go down the Delombok path, which I really wanted to avoid.
answered Apr 18 '17 at 13:42
Daniel SeltzerDaniel Seltzer
664
664
add a comment |
add a comment |
You will also need to check what version of java is there in path . My issue was with Java 1.8 & 3.5 version . To get it working I had to switch to 1.7 & 3.5 . Please note we are still on 1.7
add a comment |
You will also need to check what version of java is there in path . My issue was with Java 1.8 & 3.5 version . To get it working I had to switch to 1.7 & 3.5 . Please note we are still on 1.7
add a comment |
You will also need to check what version of java is there in path . My issue was with Java 1.8 & 3.5 version . To get it working I had to switch to 1.7 & 3.5 . Please note we are still on 1.7
You will also need to check what version of java is there in path . My issue was with Java 1.8 & 3.5 version . To get it working I had to switch to 1.7 & 3.5 . Please note we are still on 1.7
answered Mar 7 '18 at 12:39
user666user666
675716
675716
add a comment |
add a comment |
First you should locate your lombok source (java annotated with lombok) into src/main/lombok and add the lombok-maven-plugin to your project like this:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you don't like to use the lombok-maven-plugin you need to add the following:
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you really like to put your lomboked source into src/main/java instead of the default /src/main/lombok you have to go this way which is not recommended:
<build>
<sourceDirectory>target/generated-sources/delombok</sourceDirectory>
<testSourceDirectory>target/generated-test-sources/delombok</testSourceDirectory>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</build>
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
add a comment |
First you should locate your lombok source (java annotated with lombok) into src/main/lombok and add the lombok-maven-plugin to your project like this:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you don't like to use the lombok-maven-plugin you need to add the following:
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you really like to put your lomboked source into src/main/java instead of the default /src/main/lombok you have to go this way which is not recommended:
<build>
<sourceDirectory>target/generated-sources/delombok</sourceDirectory>
<testSourceDirectory>target/generated-test-sources/delombok</testSourceDirectory>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</build>
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
add a comment |
First you should locate your lombok source (java annotated with lombok) into src/main/lombok and add the lombok-maven-plugin to your project like this:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you don't like to use the lombok-maven-plugin you need to add the following:
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you really like to put your lomboked source into src/main/java instead of the default /src/main/lombok you have to go this way which is not recommended:
<build>
<sourceDirectory>target/generated-sources/delombok</sourceDirectory>
<testSourceDirectory>target/generated-test-sources/delombok</testSourceDirectory>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</build>
First you should locate your lombok source (java annotated with lombok) into src/main/lombok and add the lombok-maven-plugin to your project like this:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
If you don't like to use the lombok-maven-plugin you need to add the following:
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
If you really like to put your lomboked source into src/main/java instead of the default /src/main/lombok you have to go this way which is not recommended:
<build>
<sourceDirectory>target/generated-sources/delombok</sourceDirectory>
<testSourceDirectory>target/generated-test-sources/delombok</testSourceDirectory>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.6.1</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</build>
edited Nov 13 '18 at 15:08
buræquete
5,12141748
5,12141748
answered Feb 14 '16 at 18:37
khmarbaisekhmarbaise
64.4k18121164
64.4k18121164
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
add a comment |
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
You use the delombok plugin if you want to generate de-lombok'ed sources though no? I don't need expanded sources. I have the dependency already and the files are still not compiling
– mangusbrother
Feb 14 '16 at 18:40
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
there is no "delombok plugin".
– specializt
Jan 26 '17 at 16:56
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
I don't use a delombok plugin only the goal of it See here: awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
– khmarbaise
Jan 27 '17 at 9:53
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35394885%2flombok-not-compiling-in-maven%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Where are the souces located?
src/main/java,src/main/lombok?– Tunaki
Feb 14 '16 at 17:44
java. Do they have to be under lombok?
– mangusbrother
Feb 14 '16 at 17:49
Yes. Try to move them.
– Tunaki
Feb 14 '16 at 17:52
It doesn't compile them under
src/main/lombokso it's not working– mangusbrother
Feb 14 '16 at 17:55
1
How did you ran Maven? And what's the error? You should run
mvn clean package.– Tunaki
Feb 14 '16 at 17:57