I have the following code below.
I am creating a plugin for Minecraft using the Spigot/Bukkit API and the java programming language.
I have created this using the maven tool on eclipse.
I enter mvn clean package into the terminal on my mac to compile the '.jar' file.
I then drag this '.jar' file into my 'plugins' folder on my server.
However, I keep getting the issue: java.io.FileNotFoundException: Jar does not contain plugin.yml
I am not sure why the jar file does not contain the plugin.yml.
I would be so grateful for a helping hand!
pom.xml file:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>newestfile.here</groupId>
<artifactId>newestplugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
plugin.yml file:
name:newestplugin
main:newestfile.here.newestplugin.Main
version:0.0.1-SNAPSHOT
api-version: 1.19
The top few lines of my '.java' file:
package newestfile.here.newestplugin;
import java.util.UUID;
import java.nio.charset.StandardCharsets;
import java.nio.file.StandardOpenOption;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.io.File;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.entity.Player;
import org.bukkit.Location;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import java.nio.file.Files;
public class Main extends JavaPlugin implements Listener
{
boolean stopRepeater;
Organisation of nesting of packages: