Lombok: A required class was missing while executing org.projectlombok:lombok-maven-plugin:1.16.6.1:delombok: com/sun/tools/javac/util/Context

Created on 19 Sep 2015  路  7Comments  路  Source: projectlombok/lombok

Env : Windows 10 x64, Java 1.8.0_60 x64
IDE : Eclipse MARS EE
Lombok 1.16.6

successfully installed in eclipse

maven config :

      <plugin>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok-maven-plugin</artifactId>
            <version>1.16.6.1</version>
            <executions>
                <execution>
                    <id>delombok</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>delombok</goal>
                    </goals>
                    <configuration>                     
                        <addOutputDirectory>false</addOutputDirectory>
                        <sourceDirectory>src</sourceDirectory>                      
                    </configuration>
                </execution>
                <execution>
                    <id>test-delombok</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>testDelombok</goal>
                    </goals>
                    <configuration>
                        <addOutputDirectory>false</addOutputDirectory>
                        <sourceDirectory>test</sourceDirectory>
                    </configuration>
                </execution>
            </executions>


        </plugin>

dependency with scope "provided" has also been added - the project itself is somewhat complex but rest assured : everything works flawlessly without lombok.

Problem description : maven compiles (and packages) fine if run via eclipse maven launch configuration but in the POM design view (also in the source view) the aforementioned error pops up , stacktrace :

https://gist.githubusercontent.com/DanielMack/e4f5bcbcd03b106a361e/raw/150b47a707858851dae38abba79a23286619ca83/gistfile1.txt

Most helpful comment

Yes, i solved it by deleting the Lombok dependency and closing the research task - my result was : Lombok is not production-ready yet. You might want to check again in 5-10 years or so.

All 7 comments

if the entire execution config is removed everything works - so apparently there are issues with the eclipse maven POM parser / executor

Sorry to keep you waiting for so long. The lombok-maven-plugin that defines the delombok goal, is maintained by someone else. You can report this issue in its issue tracker.

I met the same problem as you,are you resolve this problem?

Yes, i solved it by deleting the Lombok dependency and closing the research task - my result was : Lombok is not production-ready yet. You might want to check again in 5-10 years or so.

@DanielMack You could say it about maven instead. I'm using lombok (in production) since the very beginning and delomboking with gradle works fine. While maven has alternatives, lombok does not (with @AutoValue and http://immutables.github.io coming close), so my choice is obvious. YMMV.

Nobody was talking about Maven and how you value it and noone asked for maven alternatives. I think you might want to take your crusade against it somewhere else

add this to your pom

        <!-- fix delombok in eclipse (only used for javadoc) -->
        <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>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>

                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

zenglian picture zenglian  路  3Comments

gardenias picture gardenias  路  3Comments

garfieldnate picture garfieldnate  路  3Comments

Maaartinus picture Maaartinus  路  3Comments

michaelkuechler picture michaelkuechler  路  3Comments