Make POM more explicit about plugin versions (#1153)

- Add missing POM sections: name, description, inceptionYear, packaging, licenses, and issueManagement
- For tests, use junit-jupiter instead of both junit-jupiter-api and junit-jupiter-engine
- Dependency versions:
    - junit-jupiter 5.6.2 -> 5.7.0
    - git-commit-id-plugin 3.0.0 -> 4.0.3
- Explicitly use the latest plugin versions, rather than the dated default versions from the Super POM
- Define Java language source- and target level directly in the maven-compiler-plugin configuration
This commit is contained in:
Erik Eide 2020-12-14 09:09:58 +01:00 committed by GitHub
parent 2d68fa5cd2
commit c235bb0a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

183
pom.xml
View File

@ -1,23 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>com.griefprevention</groupId> <groupId>com.griefprevention</groupId>
<artifactId>GriefPrevention</artifactId> <artifactId>GriefPrevention</artifactId>
<version>16.17.1-SNAPSHOT</version> <version>16.17.1-SNAPSHOT</version>
<name>GriefPrevention</name>
<description>The official self-service anti-griefing Bukkit plugin for Minecraft servers since 2011.</description>
<inceptionYear>2011</inceptionYear>
<packaging>jar</packaging>
<licenses>
<license>
<name>GPL-3.0-or-later</name>
<url>https://choosealicense.com/licenses/gpl-3.0/</url>
</license>
</licenses>
<properties> <properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/TechFortress/GriefPrevention/issues</url>
</issueManagement>
<scm>
<developerConnection>scm:git:https://github.com/TechFortress/GriefPrevention.git</developerConnection>
<tag>HEAD</tag>
</scm>
<repositories> <repositories>
<repository> <repository>
<id>paper-repo</id> <id>paper-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url> <url>https://papermc.io/repo/repository/maven-public/</url>
</repository> </repository>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository> </repository>
<repository> <repository>
<id>worldedit-worldguard-repo</id> <id>worldedit-worldguard-repo</id>
@ -27,33 +52,34 @@
<id>essx-repo</id> <id>essx-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url> <url>https://ci.ender.zone/plugin/repository/everything/</url>
</repository> </repository>
</repositories> </repositories>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<finalName>${project.name}</finalName> <finalName>${project.name}</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<filtering>true</filtering> <filtering>true</filtering>
<targetPath>.</targetPath>
<includes> <includes>
<include>plugin.yml</include> <include>plugin.yml</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<!-- append git commit hash to version--> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Append git commit hash to version -->
<plugin> <plugin>
<groupId>pl.project13.maven</groupId> <groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId> <artifactId>git-commit-id-plugin</artifactId>
<version>3.0.0</version> <version>4.0.3</version>
<executions> <executions>
<execution> <execution>
<id>get-the-git-infos</id> <id>get-the-git-infos</id>
@ -74,73 +100,94 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build> </build>
<dependencies> <dependencies>
<!--Bukkit API. Bukkit has never ever deployed a release version.--> <!-- Bukkit API. Bukkit has never ever deployed a release version -->
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version> <version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!--Worldguard dependency--> <!-- Worldguard dependency -->
<dependency> <dependency>
<groupId>com.sk89q.worldguard</groupId> <groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId> <artifactId>worldguard-bukkit</artifactId>
<version>7.0.4-SNAPSHOT</version> <version>7.0.4-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
</exclusion> </exclusion>
<!--<exclusion>--> <exclusion>
<!--<groupId>com.sk89q.worldedit</groupId>--> <groupId>com.sk89q</groupId>
<!--<artifactId>worldedit-bukkit</artifactId>--> <artifactId>commandbook</artifactId>
<!--</exclusion>--> </exclusion>
<exclusion> <exclusion>
<groupId>com.sk89q</groupId> <groupId>org.bstats</groupId>
<artifactId>commandbook</artifactId> <artifactId>bstats-bukkit</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!--Vault dependency--> <!-- Vault dependency -->
<dependency> <dependency>
<groupId>net.milkbowl.vault</groupId> <groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId> <artifactId>VaultAPI</artifactId>
<version>1.7</version> <version>1.7</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!--Tests--> <!-- Tests -->
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId> <artifactId>junit-jupiter</artifactId>
<version>5.6.2</version> <version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<scm>
<developerConnection>scm:git:https://github.com/TechFortress/GriefPrevention.git</developerConnection>
<tag>HEAD</tag>
</scm>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>ossrh</id> <id>ossrh</id>