我有一个自定义的hybris组件。我在external-dependencies.xml
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
已安装Lombok插件,启用了注释处理。在IDE中,我看到了生成的方法,但是当我运行ant clean all
时会出错。
例如,这是一个测试类:
@Data
public class TestDto {
private String prop;
}
这里是示例用法
TestDto test = new TestDto();
test.setProp("");
test.getProp();
但是ant clean all
说以下:
[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
我想念什么?
编辑:
这里是extensioninfo.xml
。 Maven已启用。
<?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>
我无法评论龙目岛,因为我没有在Hybris中使用它。但是,创建Data或DTO类的常用方法(也许是正确的方法)是通过* -beans.xml。