Can't permanently exclude delombok from generated source

Answered

Hello.

I'm having problem with delombok plugin and IDEA. My project uses delombok and it generates directory target/generated-sources/delombok. On each mvn clean install I must mark this folder as "Excluded" or "Unmark as Generated Sources Root".

Also I noticed information message in Project Structure what "Module is imported from Maven. Any changes mane in its configuration may be lost after importing".

I tried to find solution for this problem but could not find anything concrete.

So, is there any way I can permanently remove this folder from source scan?

Thanks.

6
3 comments

See if this setting helps:

1
Avatar
Permanently deleted user

Serge, thanks for respond but I tried all four options from this menu. Didn't help.

0

If you are running delombok through the lombok-maven-plugin you can specify a directory outside target/generated-sources and IDEA wont pick up the sources.

If you like me want to generate java-doc I had to do the following:

<build>
 <plugins>
<plugin>
<!-- this plugin is needed for the maven-javadoc-plugin (when you use lombok builders) -->
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<configuration>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<outputDirectory>${project.build.directory}/delombok</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<sourcepath>${project.build.directory}/delombok</sourcepath>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
0

Please sign in to leave a comment.