Skip to content

Instantly share code, notes, and snippets.

@sparsick
Last active July 16, 2024 08:34
Show Gist options
  • Save sparsick/aec73d514b1ef248d92d to your computer and use it in GitHub Desktop.
Save sparsick/aec73d514b1ef248d92d to your computer and use it in GitHub Desktop.
Maven POM Template for Java Projects
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0.0-SNAPSHOT</version>
<name></name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.6.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
@infobrixGit
Copy link

For java 17 , you can use this example - https://github.com/felix-seifert/java-17-maven-project/blob/main/pom.xml ( no need of shade plugin)

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