Just new to IntelliJ Idea. I have maven project which has few generated source java files.
When I import that project Idea complaints about generated source files are missing but I can see those files under target/generated-sources
. How can I add those files in the classpath.
Asked
Active
Viewed 3.1k times
9

Abhishek Jain
- 3,562
- 2
- 26
- 44

user2030632
- 111
- 1
- 1
- 7
-
Try this solution, it may resolve your issue. [click here for the solution](https://stackoverflow.com/a/47278829/7855267) – Asad Abdin Nov 14 '17 at 07:24
2 Answers
20
You can go to Files > Project Structure
and then choose your module and on the sources tab you can navigate to the generated-sources
dir and click Mark as > Sources
:
Additionally, folder could be assigned to the specific type from the Project
panel via mark directory as
context menu.
To have maven do it automatically, look here: How to create folder for generated sources in Maven?
2
If you are using Springboot Application.
just follow the step in IntelliJ.
- Right-click on project folder.
- Select maven.
- Generate source and update the project folder

Maytham Fahmi
- 31,138
- 14
- 118
- 137

shubham
- 89
- 7