【问题标题】:Lombok doesn't work with error-proneLombok 不适用于容易出错的情况
【发布时间】:2018-04-30 13:12:57
【问题描述】:

Lombok 表达式在编译时出错

[ERROR] error-prone version: 2.3.1
[ERROR] BugPattern: InconsistentCapitalization
[ERROR] Stack Trace:
[ERROR] java.lang.NullPointerException
[ERROR] at com.google.errorprone.fixes.SuggestedFixes.renameVariable(SuggestedFixes.java)
  • 龙目岛版本:1.16.16
  • 容易出错的版本:2.3.1
  • plexus-compiler-javac-errorprone : 2.8.3

【问题讨论】:

    标签: lombok errorprone


    【解决方案1】:

    你试过lombok 1.16.20吗?

    披露:我是龙目岛开发人员。

    【讨论】:

      【解决方案2】:

      你可以试试:

                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>3.8.0</version>
                      <configuration>
                          <source>8</source>
                          <target>8</target>
                          <encoding>UTF-8</encoding>
                          <compilerArgs>
                              <arg>-XDcompilePolicy=simple</arg>
                              <arg>-Xplugin:ErrorProne</arg>
                          </compilerArgs>
                          <annotationProcessorPaths>
                              <path>
                                  <groupId>com.google.errorprone</groupId>
                                  <artifactId>error_prone_core</artifactId>
                                  <version>2.5.1</version>
                              </path>
                              <path>
                                  <groupId>org.projectlombok</groupId>
                                  <artifactId>lombok</artifactId>
                                  <version>1.18.18</version>
                              </path>
                              <!-- Other annotation processors go here.
      
                              If 'annotationProcessorPaths' is set, processors will no longer be
                              discovered on the regular -classpath; see also 'Using Error Prone
                              together with other annotation processors' below. -->
                          </annotationProcessorPaths>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      

      【讨论】:

        猜你喜欢
        • 2018-07-22
        • 2020-05-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-09-09
        • 2019-02-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多