-
Hi MapStruct team, I'm currently working with MapStruct's codebase and noticed that during development, extra Intelij IDEA configuration is needed for recognizing GEM-generated sources (like MapperGem) in the processor/target/generated-sources/annotations directory. Specifically, these generated files need to be manually marked as "Generated Sources Root" in the IDE to be properly recognized. I might be missing something, but I was wondering if there are any existing configurations or recommended practices for handling these generated source directories automatically in development environments? If there isn't an existing solution, I found that adding the build-helper-maven-plugin to processor/pom.xml could automatically mark the generated sources directory for IDEs. Here's the specific change I'm thinking about: <build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/annotations</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> I'm curious about your thoughts on this approach and whether there might be specific reasons for the current setup. Thank you for your time and for maintaining this excellent project. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Which IntelliJ version are you using @fotgu? For me IntelliJ is automatically making the |
Beta Was this translation helpful? Give feedback.
I just tried it with a fresh clone and a new IntelliJ project. I did the following steps:
At this point the build failed and the
processor/target/generated-sources/annotations
. What I did next is the Maven "Reload All Maven Projects"After doing the that the folder became part of my sources.