Setup project for plugin

This commit is contained in:
SemvdH
2025-10-14 18:31:43 +02:00
parent a8121a66b9
commit d7525bdbd0
4 changed files with 116 additions and 86 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}

View File

@@ -1,90 +1,110 @@
<?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" <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"> 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>nl.interestingcorner</groupId> <groupId>nl.interestingcorner</groupId>
<artifactId>ic_plugin</artifactId> <artifactId>ic_plugin</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<name>ic_plugin</name> <name>ic_plugin</name>
<!-- FIXME change it to the project's website --> <!-- FIXME change it to the project's website -->
<url>http://www.example.com</url> <url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release> <maven.compiler.release>17</maven.compiler.release>
</properties> </properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.junit</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-bom</artifactId> <artifactId>junit-jupiter-api</artifactId>
<version>5.11.0</version> <scope>test</scope>
<type>pom</type> </dependency>
<scope>import</scope> <!-- Optionally: parameterized tests support -->
</dependency> <dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</dependencyManagement>
<dependencies> <build>
<dependency> <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<groupId>org.junit.jupiter</groupId> <resources>
<artifactId>junit-jupiter-api</artifactId> <resource>
<scope>test</scope> <directory>${project.basedir}/src/main/resources</directory>
</dependency> <includes>
<!-- Optionally: parameterized tests support --> <include>plugin.yml</include>
<dependency> </includes>
<groupId>org.junit.jupiter</groupId> </resource>
<artifactId>junit-jupiter-params</artifactId> </resources>
<scope>test</scope> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
</dependency> <plugins>
</dependencies> <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<build> <artifactId>maven-clean-plugin</artifactId>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <version>3.4.0</version>
<plugins> </plugin>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>3.4.0</version> <version>3.3.1</version>
</plugin> </plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <plugin>
<plugin> <artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId> <version>3.13.0</version>
<version>3.3.1</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-surefire-plugin</artifactId>
<artifactId>maven-compiler-plugin</artifactId> <version>3.3.0</version>
<version>3.13.0</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId> <version>3.4.2</version>
<version>3.3.0</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-install-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId> <version>3.1.2</version>
<version>3.4.2</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-deploy-plugin</artifactId>
<artifactId>maven-install-plugin</artifactId> <version>3.1.2</version>
<version>3.1.2</version> </plugin>
</plugin> <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-site-plugin</artifactId>
<version>3.1.2</version> <version>3.12.1</version>
</plugin> </plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> <plugin>
<plugin> <artifactId>maven-project-info-reports-plugin</artifactId>
<artifactId>maven-site-plugin</artifactId> <version>3.6.1</version>
<version>3.12.1</version> </plugin>
</plugin> </plugins>
<plugin> </pluginManagement>
<artifactId>maven-project-info-reports-plugin</artifactId> </build>
<version>3.6.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> </project>

View File

@@ -1,10 +1,14 @@
package nl.interestingcorner; package nl.interestingcorner;
/** import org.bukkit.plugin.java.JavaPlugin;
* Hello world!
*/ public class App extends JavaPlugin {
public class App { @Override
public static void main(String[] args) { public void onEnable() {
System.out.println("Hello World!"); getLogger().info("Hello, SpigotMC!");
}
@Override
public void onDisable() {
getLogger().info("See you again, SpigotMC!");
} }
} }

View File

@@ -0,0 +1,3 @@
main: nl.interestingcorner.App
name: InterestingCornerPlugin
version: 0.1