Lombok与maven在Openshift(Jboss AS)构建失败



我开始在我的项目中使用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似乎根本找不到这个类。

我应该注意,我使用的是java7。

我遇到了同样的问题。这与maven编译插件的旧版本有关。

要修复它,请将您的插件版本更改为专门的请求maven编译2.5.1(或更高版本)

这是我的maven pom.xml 的重要部分

<profiles>
    <profile>
     <!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
     <!-- Use this profile for any OpenShift specific customization your app will need. -->
     <!-- By default that is to put the resulting archive into the 'deployments' folder. -->
     <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
     <id>openshift</id>
     <build>
        <finalName>myname</finalName>
        <plugins>
          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <outputDirectory>deployments</outputDirectory>
                      <warName>ROOT</warName>
                </configuration>
            </plugin>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
            </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

注意:maven编译器插件-2.5.1版

相关内容

最新更新