I have a custom hybris component. I added the following to the external-dependencies.xml
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
The Lombok plugin is installed, the annotation processing is enabled. In the IDE I see the generated methods, but when I run ant clean all I get errors.
For example here is a test class:
@Data
public class TestDto {
private String prop;
}
Here is an example usage of it
TestDto test = new TestDto();
test.setProp("");
test.getProp();
But the ant clean all says the following:
[yjavac] Compiling 700 source files to /Users/myUser/Projects/MyProject/hybris/myComponent/classes
[yjavac] ----------
[yjavac] 1. ERROR in /Users/myUser/Projects/MyProject/hybris/myComponent/src/service/ExampleService.java (at line 65)
[yjavac] test.setProp("");
[yjavac] ^^^^^^^
[yjavac] The method setProp(String) is undefined for the type TestDto
[yjavac] ----------
[yjavac] 2. ERROR in /Users/myUser/Projects/MyProject/hybris/myComponent/src/service/ExampleService.java (at line 66)
[yjavac] test.getProp();
[yjavac] ^^^^^^^
[yjavac] The method getProp() is undefined for the type TestDto
[yjavac] ----------
[yjavac] 2 problems (2 errors)
BUILD FAILED
What am I missing?
Edit:
Here is the extensioninfo.xml. Maven is enabled.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extensioninfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extensioninfo.xsd">
<extension abstractclassprefix="Generated" classprefix="MyPrefix" managername="MyManager"
managersuperclass="de.hybris.platform.jalo.extension.Extension" name="myName" usemaven="true">
<requires-extension name="Mycore"/>
<requires-extension name="Mymqintegration"/>
<requires-extension name="Mycommons"/>
<coremodule generated="true" manager="com.example.api.jalo.MyManager"
packageroot="com.example.api"/>
<webmodule jspcompile="false" webroot="/api"/>
</extension>
</extensioninfo>
Edit2:
I found some tips about buildcallbacks.xml. I'm pretty new in hybris so I went trough some google -> copy -> paste -> try -> repeat cycle with the buildcallbacks but none of the found solution worked for me.
Here are some example I tried out without any success:
<target name="myModuleName_lombok">
<javac srcdir="src" destdir="build" source="1.8">
<classpath location="lib/lombok-1.18.12.jar"/>
</javac>
<echo message=" adding lombok"/>
</target>
<macrodef name="myExtName_before_build">
<sequential>
<addToClasspath classpathproperty="ext.MyExtName.classpath" path="${ext.MyExtname.path}/lib/lombok-1.18.12.jar"/>
</sequential>
</macrodef>