morpheus
morpheus

Reputation: 20330

Problem using lombok and checkframework together in Maven build

I am trying to use both lombok and checkerframework in a Maven build like this:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>      
                <jdkToolchain>
                    <version>21</version>
                </jdkToolchain>
                <fork>true</fork>                 
              <annotationProcessorPaths>
              <path>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                        <version>${lombok.version}</version>
                    </path> 
                <path>
                  <groupId>org.checkerframework</groupId>
                  <artifactId>checker</artifactId>
                  <version>3.42.0</version>
                </path>
              </annotationProcessorPaths>
              <annotationProcessors>                
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>              
</annotationProcessors>                 
...

with this lombok does not work and I get errors related to lombok e.g.:

error: cannot find symbol
[ERROR]   symbol:   variable log

If I remove this code:

<annotationProcessors>
                <!-- Add all the checkers you want to enable here -->
                <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>                
              </annotationProcessors>                 

then the lombok error goes away but now checkerframework does not run. How can I make both of them work?

Upvotes: 0

Views: 62

Answers (0)

Related Questions