Skip to content

Commit

Permalink
Delete delomboked sources generated during release builds (#287)
Browse files Browse the repository at this point in the history
Use the maven-antrun-plugin to delete the delomboked source
code which resides in target/generated-sources/delombok.

Closes #286
  • Loading branch information
sleberknight committed Feb 4, 2024
1 parent fa83486 commit 7ec1b58
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
<jshell-maven-plugin.version>1.4</jshell-maven-plugin.version>
<lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
Expand Down Expand Up @@ -422,6 +423,34 @@
</configuration>
</plugin>

<!--
After the javadoc runs, duplicate .java files will exist in the
target/generated-sources/delombok directory.
These duplicate classes will be seen by IDEs and cause problems.
The following ensures we delete the delomboked sources once we
no longer need them after generating the javadoc.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>delete-delombok-generated-sources</id>
<phase>verify</phase> <!-- ensure this executes after javadoc -->
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${project.build.directory}/generated-sources/delombok"/>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down

0 comments on commit 7ec1b58

Please sign in to comment.