Concise steps to make the beemail project a Maven project with JUnit.
- New File >
pom.xml - Add boilerplate config to pom.xml
<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.beemail</groupId>
<artifactId>beemail</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>beemail</name>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<useModulePath>false</useModulePath>
</configuration>
</plugin>
</plugins>
</build>
</project>- Right click on
pom.xml> Add as Maven Project - Richt click on project > New Directory >
src/main/java/com/beemail - Right click on
com.beemail> New Java class >Main> InMaintype psvm for boilerplatemainmethod > AddSystem.out.println("Hello World");and run the method using the green play button to test it works. - Finally add a
.gitignorefile > New file >.gitignore
# Maven target directory
target/
# IntelliJ IDEA project files
.idea/
*.iml
# Logs
*.log
# OS-specific files
.DS_Store
Thumbs.db
# Build output
out/
# Temporary files
*.tmp
*.swp
# Java-specific
*.class
# Generated files
*.jar
*.war
*.ear
# IntelliJ caches
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# IntelliJ plugin-specific
.idea/**/gradle.xml
.idea/**/libraries
# Ignore compiled test results
test-output/
# Ignore any local environment configs
.env