Open ncovercash opened 2 years ago
If anyone else has this issue, I got around it by invoking delombok
directly, the old-fashioned way:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath />
<argument>lombok.launch.Main</argument>
<argument>delombok</argument>
<argument>--verbose</argument>
<argument>--nocopy</argument>
<argument>${project.build.directory}/generated-sources/api</argument>
<argument>${project.basedir}/src/main/java</argument>
<argument>-d</argument>
<argument>${project.build.directory}/generated-sources/delombok</argument>
</arguments>
</configuration>
<executions>
<execution>
<id>delombok</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
To add multiple source folders, you can just add additional arguments. --nocopy
prevents it from copying extra things like pom.xml
or other stuff and -d
specifies the output folder.
We would need this functionality as well, so +1 from me for this feature request (and thank you for the workaround).
Hi,
I added a PR for this one: #157
Please note that this is an incompatible API change regarding the configuration (as can be seen in the example pom.xml).
Heya!
I'm working on a Spring Boot application and, as part of it, generate some code based on an API schema (with
openapi-generator
). The templates I have for this work great and take advantage of@Data
and some other Lombok annotations, as does my main source code.With
openapi-generator
, it dumps all of its created source code into/target/generated-sources/api
(and adds it to the build path). My normal sources are in/src/main/java
, however, so I cannot delombok all of this at once.Here is my attempted Maven configuration:
This will successfully delombok the generated API sources (
delombok-openapi
), however, as soon as it attempts to delombok thesrc/main/java
sources (delombok-main
), it cannot find any of the lombok-generated methods (getters, setters, etc) that should have been generated in thedelombok-openapi
step (or at least generated at that point, since either delombok execution should be able to generate all the setters/etc?).Without this plugin's executions my build works fine, so the code itself is (somehow) working. Both folders of code rely on each other and both use Lombok, so I'm not sure why it's so picky. Swapping the execution order changes nothing (it's still
main
with the issues).