Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Idea generated source

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.

like image 507
user2030632 Avatar asked Mar 26 '15 22:03

user2030632


People also ask

What does Maven generate sources do?

The “maven-source” plugin is used to pack your source code and deploy along with your project. This is extremely useful, for developers who use your deployed project and also want to attach your source code for debugging.

How can I get Java source code in IntelliJ?

zip to IntelliJ IDEA. 2.2 Platform Settings -> SDKs -> Select Sourcepath -> plus icon -> select src. zip from the JDK installed path. 2.3 Done.


2 Answers

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:

Mark as sources - IDEA

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?

like image 91
Alexander Avatar answered Oct 10 '22 23:10

Alexander


If you are using Springboot Application.

just follow the step in IntelliJ.

  1. Right-click on project folder.
  2. Select maven.
  3. Generate source and update the project folder
like image 39
shubham Avatar answered Oct 10 '22 22:10

shubham