Changing default java module structure in IntelliJ IDEA

I would like to know how to change the structure of the default java module in IntelliJ IDEA:

module_name/src 

Where src is marked as "sources" to:

 module_name/src /main/java /test/java 

Where main / java is marked as sources and test / java is marked as test sources.

Is there a way that I can do this by default, so I don’t have to manually do it every time?

+4
source share
2 answers

You can create a project that meets your specifications, and then save it as a template that will be available when creating a new project.

See the IntelliJ documentation for [Saving a project as a template] ( https://www.jetbrains.com/help/idea/save-project-as-template-dialog.html ).

+4
source

The right way is to create pom.xml and reorganize the source so that it works with maven. After that - just import pom.xml into Idea, it will automatically recognize the structure of the maven project.

Manual method - use "Module Settings" β†’ "Sources" and manually change the source folders for your structure. See an example screen here http://wiki.jetbrains.net/intellij/File:Project_structure_dialog_left_hand_pane.png

+2
source

Source: https://habr.com/ru/post/1487647/


All Articles