Open crutcher opened 7 months ago
As a workaround you can specify the version of lombok to use in the plugin-section of your pom like that:
<properties>
<lombok.version>1.18.30</lombok.version>
<lombok.plugin.version>1.18.20.0</lombok.plugin.version>
</properties>
...
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>${lombok.plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<outputDirectory>${project.build.directory}/delombok</outputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
</plugin>
which works for me with Java 21.
I have similar issue.
but I get a different error.
The parameters 'encoding' for goal org.projectlombok:lombok-maven-plugin:1.18.20.0:delombok are missing or invalid
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<outputDirectory>
${project.build.directory}/delombok
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Adding/Removing the encoding tag doesn't make any difference.
See: https://stackoverflow.com/questions/77171270/compilation-error-after-upgrading-to-jdk-21-nosuchfielderror-jcimport-does-n