带有 lombok 问题的 Openshift

Openshift with lombok issue

我用wildfly 8的openshift模板创建了一个新的应用程序,一切正常。

添加 lombok:1.16.4 库后,服务器中的 maven 无法编译,在我的本地机器上运行正常。

当我在 openshift 机器上 运行 mvn -e -Popenshift -DskipTests -X compile 时,它说我:

[DEBUG] Command line options:
[DEBUG] -d
/var/lib/openshift/ID/app-root/runtime/repo/target/classes
-classpath
/var/lib/openshift/ID/app-root/runtime/repo/target/classes:/var/lib/openshift/ID/.m2/repository/javax/javaee-api/7.0/javaee-api-7.0.jar:/var/lib/openshift/ID/.m2/repository/com/sun/mail/javax.mail/1.5.0/javax.mail-1.5.0.jar:/var/lib/openshift/ID/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/var/lib/openshift/ID/.m2/repository/org/projectlombok/lombok/1.16.4/lombok-1.16.4.jar:/var/lib/openshift/ID/.m2/repository/org/torpedoquery/org.torpedoquery/1.7.0/org.torpedoquery-1.7.0.jar:/var/lib/openshift/ID/.m2/repository/org/javassist/javassist/3.18.0-GA/javassist-3.18.0-GA.jar:/var/lib/openshift/ID/.m2/repository/org/eclipse/persistence/javax.persistence/2.0.0/javax.persistence-2.0.0.jar:/var/lib/openshift/ID/.m2/repository/org/objenesis/objenesis/1.3/objenesis-1.3.jar:/var/lib/openshift/ID/.m2/repository/com/google/guava/guava/11.0.2/guava-11.0.2.jar:/var/lib/openshift/ID/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/var/lib/openshift/ID/.m2/repository/org/apache/commons/commons-lang3/3.0/commons-lang3-3.0.jar:
-sourcepath
/var/lib/openshift/ID/app-root/runtime/repo/src/main/java:
ALL_MY_CLASSES
-s /var/lib/openshift/ID/app-root/runtime/repo/target/generated-sources/annotations
-g -nowarn -target 1.8 -source 1.8 -encoding UTF-8

还有一个编译错误,问题是,当我 运行

javac $ALL_ARGUMENTS_FROM_MAVEN_DEBUG_INFO (from the -d) 

运行正常,post javac 手动编译mvn compile 报无问题(直到执行clean,或更改文件)

我检查了环境中的变量,没有发现任何错误,这是不同之处:

此外,如果我在 运行 javac 命令时删除类路径中的 lombok 部分,我会从 maven 得到同样的错误。

从 openshift 创建 maven 的环境有什么区别 ignore lombok?

Here 是两个编译的link(带调试输出)

问题与 maven-compiler-plugin 有关,最新版本无处不在,将其添加到 pom:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <compilerVersion>1.8</compilerVersion>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

openshift 中默认配置的插件版本太旧 (2.3),与 lombok 不兼容。