我开始在我的项目中使用 Lombok,并且在我的本地环境中一切正常(maven compile 正在运行)。当我尝试推送到 openshift(Jboss 安装)时,openshift 中的 maven 编译失败并出现错误:
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ german-school ---
[INFO] Compiling 13 source files to /var/lib/openshift/5290ebf4500446c6e20000b8/app-root/runtime/repo/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/openshift/5290ebf4500446c6e20000b8/app-root/runtime/repo/src/main/java/gr/alx/german/model/Word.java:[95,26] error: cannot find symbol
[ERROR] class Word /var/lib/openshift/5290ebf4500446c6e20000b8/app-root/runtime/repo/src/main/java/gr/alx/german/model/Word.java:[102,18] error: cannot find symbol
[ERROR] variable shuffledWord of type Word /var/lib/openshift/5290ebf4500446c6e20000b8/app-root/runtime/repo/src/main/java/gr/alx/german/model/Word.java:[114,19] error: cannot find symbol
[ERROR] variable shuffledWord of type Word /var/lib/openshift/5290ebf4500446c6e20000b8/app-root/runtime/repo/src/main/java/gr/alx/german/controller/AdminController.java:[70,18] error: cannot find symbol
[ERROR] class Word
...
...
...
...
[INFO] 33 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
为了清楚起见,我没有显示所有错误。“Word”类是使用 Lombok 注释进行注释的类。Maven 似乎根本找不到这个类。
我应该注意我使用的是 java 7。