lombok.maven icon indicating copy to clipboard operation
lombok.maven copied to clipboard

Missing class JCTree$JCCompilationUnit inside Eclipse

Open Verdoso opened this issue 7 years ago • 3 comments

Hi there, I'm having a strange issue with latest releases. Everything seems to work fine outside Eclipse, but the maven container inside Eclipse now complains about

org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.projectlombok:lombok-maven-plugin:1.16.20.0:delombok: com/sun/tools/javac/tree/JCTree$JCCompilationUnit

I tried upgrading to the latest release and that does not solve it.

It's not critical, as I can still run maven, even inside Eclipse, and it works fine. It just looks weird having the project tagged as "broken" when there is nothing wrong with it.

Verdoso avatar Feb 14 '18 08:02 Verdoso

What version of Eclipse? What OS? What is the precise JDK being used by Eclipse?

awhitford avatar Feb 18 '18 08:02 awhitford

Eclipse: Oxygen.2 Release (4.7.2) (Build id: 20171218-0600) Maven plugin m2e: 1.8.2.20171007-0217 Maven: Embedded 3.3.9/1.8.2.20171007-0216 Windows 10 Java 8x64

It happens in both my computers with the same installation.

Verdoso avatar Feb 18 '18 13:02 Verdoso

I had just the same problem with a similar configuration. In case someone is looking for a workaround: @jeacott1 posted one at https://github.com/rzwitserloot/lombok/issues/925#issuecomment-368736923. The following extract just adds the delombokTest goal to fix both of them.

<pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.projectlombok</groupId>
                                        <artifactId>lombok-maven-plugin</artifactId>
                                        <versionRange>[1,)</versionRange>
                                        <goals>
                                            <goal>delombok</goal>
                                            <goal>delombokTest</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

lars-sh avatar Aug 02 '18 23:08 lars-sh