Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No lombok-maven-plugin build for lombok 1.18.30, breaks JDK 21 delombok builds #181

Open
crutcher opened this issue Jan 23, 2024 · 2 comments

Comments

@crutcher
Copy link

Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'

See:
https://stackoverflow.com/questions/77171270/compilation-error-after-upgrading-to-jdk-21-nosuchfielderror-jcimport-does-n

@h-westphal
Copy link

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.

@crimsonvspurple
Copy link

crimsonvspurple commented Apr 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants