That is the basic folder structure of a maven project. IntelliJ usually recognizes this and sets up sensical defaults for you.

If it didn't (or if it did but you modified them afterwards), you need to set up your java folder as the sources folder (i.e. the folder that contains the source code).

For this, you need to:

  1. Go to your project structure settings: File > Project Structure
  2. Select your project in the middle panel
  3. Select the 'sources' tab in the right panel
    • Note from a comment (thanks @Line): In IntelliJ 2018.3.5, you "select 'modules' tab in left panel".
  4. Navigate to the src/main/java folder and select it
  5. Mark it as Sources

Repeat for test folder (mark as 'Tests'), resources (mark as 'Resources'), test-resources (mark as 'Test Resources'), etc.

Answer from blurfus on Stack Overflow
🌐
JetBrains
jetbrains.com › help › idea › convert-a-regular-project-into-a-maven-project.html
Add Maven support to an existing Java project | IntelliJ IDEA Documentation
IntelliJ IDEA generates a standard Maven layout in the Project tool window. IntelliJ IDEA also creates a corresponding structure with Lifecycle and Repositories in the Maven tool window.
Discussions

java - How do you "Mavenize" a project using Intellij? - Stack Overflow
Connect and share knowledge within a single location that is structured and easy to search. Learn more about Teams ... I have seen many posts about using eclipse to Mavenize a project. Is there a easy way to do that in IntelliJ? More on stackoverflow.com
🌐 stackoverflow.com
java - Intellij maven structure - Stack Overflow
I am new on Intellij and have some troubles about checking out an existing maven project. In the past using eclipse when I check out an existing maven project it checks out the a pom file and the "src" folder to project explorer view, then I used to right click project, configure, configure as maven project. This used to create a file structure ... More on stackoverflow.com
🌐 stackoverflow.com
August 21, 2018
Weird IntelliJ forgetting test roots problem
Try to use this: false src/test/resources false src/test/java ** **/*.java ... More on reddit.com
🌐 r/IntelliJIDEA
2
2
February 19, 2016
IntelliJ Idea with Maven Java project in WSL
take it out of WSL entirely... I don't use Windows or WSL, but a symbolic link is... well... symbolic, so if it is managed by the file system under WSL then that is going to confuse things to no end given you are using a POSIX file system concept from within Windows. At best, hardlinks might work better if at all possible, but failing that, just move the directory out of WSL entirely. Even if it doesn't fix anything, you've ruled out that massive factor. Next thing would be to check your JVM settings in the IDE/project settings pages. More on reddit.com
🌐 r/IntelliJIDEA
14
November 16, 2025
🌐
JetBrains
jetbrains.com › help › idea › delegate-build-and-run-actions-to-maven.html
Maven projects | IntelliJ IDEA Documentation
In the Maven tool window, right-click a linked project. From the context menu, select Sync Project . On invoking this action, IntelliJ IDEA parses the project structure in the Maven tool window.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › working-with-maven › creating-a-project
Creating a Maven project - JetBrains Guide
February 17, 2023 - If you're creating a simple project, you don't need to select an archetype. If you click on Artifact Coordinates you'll see more Maven settings. You can declare a group id, and the artifact id of the application itself. Press Create, and IntelliJ IDEA will generate the basic pom.xml file as well as the default directory structure for a Maven project with the source and test folders defined.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206885365-Maven-project-structure
Maven project structure – IDEs Support (IntelliJ Platform) | JetBrains
April 23, 2007 - The fundamental reason of Maven putting everything in different directories is that they are trying to infer the purpose of a file from it's location. The top level contains only project files, src, target and sub-modules. This gives an uniform structure which allows the plugins to reason about the application structure and do their magic without explicit configuration.
🌐
JetBrains
jetbrains.com › help › idea › project-settings-and-structure.html
Project structure settings | IntelliJ IDEA Documentation
November 18, 2025 - Configure project structure settings including SDKs, compiler output paths, and libraries in IntelliJ IDEA.
🌐
JetBrains
jetbrains.com › help › idea › maven-support.html
Maven | IntelliJ IDEA Documentation
In the main menu, go to File | Project Structure Ctrl+Alt+Shift+S. In the dialog that opens, in Project SDK, specify the JDK version and click OK to save the changes. When IntelliJ IDEA runs Maven goals, it will use the JDK version specified ...
Find elsewhere
🌐
javathinking
javathinking.com › blog › how-do-you-mavenize-a-project-using-intellij
How to Mavenize a Project in IntelliJ: Step-by-Step Guide to Setting Up Directory Structure & pom.xml — javathinking.com
IntelliJ will generate a pom.xml file in the project root. You’ll now need to restructure your project to match Maven’s conventions (see Step 2). Maven enforces a standard directory layout, which ensures consistency across projects.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206842715-Project-Structure
Project Structure – IDEs Support (IntelliJ Platform) | JetBrains
August 1, 2014 - Typically you will create a module directory in the project root directory as you create the new modules (like you comment on in your question). The typical structure is: project-root +--module-1 | +--src | +--module-1.iml +--module-1 +--src +--module-2.iml · If you have a multi-module maven project (for example that you checked out from source control), you can simply use File > Import Project then select the parent/root pom.xml file in the file chooser and click OK.
🌐
CodeJava
codejava.net › ides › intellij › create-multi-module-maven-project-intellij
How to Create Multi-Module Maven Project in IntelliJ IDEA
August 2, 2021 - The Console App and Desktop App projects have to use the common code in the Shared Library project.Using Maven, we will need to create a project acts as the root project for the modules. Each module is a separate project right inside the root project, as shown below:Note that the packaging type of the root project must be pom. And the packaging type of modules can be jar or war.Now, let’s create this multi-module project in IntelliJ IDEA.
🌐
Medium
medium.com › @iamfaisalkhatri › what-is-maven-and-how-to-create-maven-project-using-intellij-6c1924edba04
What is Maven and how to create Maven Project using IntelliJ? | by Mohammad Faisal Khatri | Medium
December 9, 2024 - Now, let’s say if I want to use this project for Web automation using Selenium and TestNG, then I will just have to navigate to Maven Repository website, copy the respective dependencies and paste it inside the dependencies block. If you have worked with Eclipse before, you might be knowing very well that after pasting the dependencies in the pom.xml if you save the file, it automatically downloads the jar files for those dependencies, however in IntelliJ we need to one more step to download the jars.
🌐
GeeksforGeeks
geeksforgeeks.org › java › how-to-create-a-maven-project-in-intellij-idea
Creating a Maven Project in IntelliJ IDEA - GeeksforGeeks
IntelliJ IDEA is an integrated development environment (IDE) written in Java and developed by JetBrains. It is widely used for developing computer software. We will see the steps to create a Maven project in IntelliJ IDEA, from initial project setup to managing dependencies, building your project, and running tests.
Published   January 9, 2026
🌐
JetBrains
jetbrains.com › help › idea › maven-projects-tool-window.html
Maven tool window | IntelliJ IDEA Documentation
September 17, 2025 - When your project is created or imported, IntelliJ IDEA displays Maven repositories under the Repositories node. If you need to add the new Maven repository, use pom.xml. For more information, refer to the Maven documentation.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › working-with-maven › importing-a-project
Importing a Maven project - JetBrains Guide
February 17, 2023 - This is very straightforward in IntelliJ IDEA. Select Open from the Welcome Screen, or the File menu, and navigate to the location of the code. You can select the root of the project and IntelliJ IDEA will figure out how to import the project, but if you specifically know this is a Maven project, and you want to use this model for your project structure, it's simplest to select the top-level pom.xml file, and the IDE will know you mean to import a Maven project.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360007424799-Opening-a-complex-project-structure-with-Maven-modules
Opening a complex project structure with Maven modules – IDEs Support (IntelliJ Platform) | JetBrains
February 9, 2020 - It's quite tedious to do on a large number of projects and I then can't see the whole directory structure at a glance... ... Currently it's not possible. Feel free to create feature request on YouTrack: https://youtrack.jetbrains.com/issues/IDEA · Please sign in to leave a comment.
🌐
Medium
medium.com › ai-qa-nexus › a-comprehensive-guide-to-creating-a-simple-maven-project-and-understanding-its-structure-c84a02c240b3
A Comprehensive Guide to Creating a Simple Maven Project and Understanding Its Structure | by Suresh Madhusanka Rodrigo | AI & QA Nexus | Medium
September 8, 2024 - (Unlocking the Benefits of Maven: A Comprehensive Guide to Installation on Windows | by Suresh Madhusanka Rodrigo | Sep, 2024 | Medium). Open IntelliJ IDEA, go to File > New > Project.
🌐
IronPDF
ironpdf.com › ironpdf for java › blog › using ironpdf for java › intellij maven
Working with Maven Projects in IntelliJ | IronPDF for Java
April 22, 2026 - Open IntelliJ IDEA and go to File > Project Structure. In the dialog that opens, under Platform Settings, click on SDKs. Click the + button and navigate to the location of your installed JDK.