Getting Started with Maven | Creating a Maven Project | Project Structure
After the project is created, a folder named SampleMavenApp is created in the working directory where the command was executed.
This is the project folder.
Folders and files are created inside it. Its structure is as follows.
SampleMavenApp folder
$ tree
.
├── pom.xml
└── src
├── main
│ └── java
│ └── com
│ └── devkuma
│ └── App.java
└── test
└── java
└── com
└── devkuma
└── AppTest.java
When you open the project, there is an src folder and a pom.xml file.
The src folder stores the various files used by the project.
All files used by the project are stored under it.
pom.xml is the build file, which will be explained later.
The src folder contains main and test.
main is the main program folder, and source code related to the project program is placed under it.
Java source code is stored in the java folder under main.
The test folder stores test-related files.
It also contains a java folder, where test packages and source code files are placed.
Both main and test have the same structure: a language-name folder, in this case java, followed by package folders and source code files.
Package and Source Code Files
The java folder under main contains a Java source code file as an example.
When you open the folder, there are com and devkuma folders, and inside them there is a file named App.java.
As the folder structure shows, com.devkuma is the package folder.
When the project was created earlier, package: com.devkuma was entered.
As a result, the sample source code file is placed in the com.devkuma package.
When creating a new program, place source code files in this folder.