'Tycho compiler plugin fail to generate lombok functions
We have an OSGI framework and we are introducing Lombok in it. In the pom.xml we added the dependency
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
but mvn install compilation still fail with
org.eclipse.tycho:tycho-compiler-plugin:2.0.0:compile (default-compile) on project XXX: Compilation failure: Compilation failure: [ERROR] ... [ERROR] ... [ERROR] The method
setXXX(String)is undefined for the type XXX
From Eclipse, everything compile and is working fine.
lombok.jar was also added to Bundle-ClassPath of MANIFEST.MF
We added the annotationProcessorPaths to the pom.xml without success
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
EDIT Even when configuring tycho compiler it doesn't work
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<source>${compileSource}</source>
<target>${compileSource}</target>
<compilerArguments>
<processor> lombok.launch.AnnotationProcessorHider$AnnotationProcessor
</processor>
</compilerArguments>
</configuration>
</plugin>
when I added set MAVEN_OPTS="-javaagent:C:\\Eclipse\\lombok.jar" compilation worked, so is there any way to add this argument inside the compiler configuration in the pom.xml with a generic path to the lombok.jar
Solution 1:[1]
I'm succeeded in using Lombok within a eclipse plugin, and building the plugin with tycho. https://github.com/poul-m/tycho-lombokizer
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | poul-m |
