How to get IDE support (code completion, etc.) for generated code?
Normally, I would add the m2e plugin to display the life cycle in the pom.xml file, as described in @koppor's answer. However, adding per-eclipse code to my pom.xml files is not an option for work, which is basically an IntelliJ store.
My solution first adds build-helper-maven-plugin to pom.xml, which works fine from the command line, but not in eclipse.
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${project.build.directory}/generated-sources/</source> </sources> </configuration> </execution> </executions> </plugin>
To fix the eclipse, I installed the Apt M2E Connector on the Eclipse Marketplace. I think that everything worked right after the reboot, and then rebuilt all my projects. Now I see the following in my sources:
src/main/java target/generated-sources ...
Feature!
Gray May 08 '18 at 18:27 2018-05-08 18:27
source share