Create a new Java project in 1, 2, 3!

What are we going to learn?

Today we will learn how we can create a new Java Project with Maven structure and using IntelliJ IDEA!

Steps

  1. Open IntelliJ IDEA and click on Create New Project

  2. From the menu, select Maven maven project

  3. Click on Next

  4. Enter GroupId, ArtifactId and the Version of the Snapshot (if you want to change it)

    • This will be automatically set in your pom.xml file!
  5. Click on Next

  6. Enter the Project Name (By default the ArtifactId will be used)

  7. Click on Finish

  8. Notice that file structure of the Java Project is generated for you project file structure

  9. Also notice that the pom.xml file is generated. Here’s an example:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mignonnesaurus.tools</groupId>
    <artifactId>mignonnesaurus-little-tools</artifactId>
    <version>1.0-SNAPSHOT</version>
</project>
  1. Cool huh! Keep having fun!