Unable to use Intellij with a generated sources folder
You can just change the project structure to add that folder as a "source" directory.
Project Structure → Modules → Click the generated-sources
folder and make it a sources
folder.
Or:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>test</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
I'm using Maven (SpringBoot application) solution is:
- Right click project folder
- Select Maven
- Select Generate Sources And Update Folders
Then, Intellij automatically import generated sources to project.