Skip to content

Instantly share code, notes, and snippets.

@Charlie-robin
Created November 27, 2025 10:23
Show Gist options
  • Select an option

  • Save Charlie-robin/472f20c15ee1f785fd7d374d20ebb056 to your computer and use it in GitHub Desktop.

Select an option

Save Charlie-robin/472f20c15ee1f785fd7d374d20ebb056 to your computer and use it in GitHub Desktop.
Beemail Maven Project Set up

Beemail Maven Project Set up

Concise steps to make the beemail project a Maven project with JUnit.

  1. New File > pom.xml
  2. 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>
  1. Right click on pom.xml > Add as Maven Project
  2. Richt click on project > New Directory > src/main/java/com/beemail
  3. Right click on com.beemail > New Java class > Main > In Main type psvm for boilerplate main method > Add System.out.println("Hello World"); and run the method using the green play button to test it works.
  4. Finally add a .gitignore file > 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment