Solved Problem with plugin.yml

Discussion in 'Spigot Plugin Development' started by DorianYTB, Jan 10, 2020.

  1. Hello i'm french !
    I have an error when I launch my plugin :

    ------------------------------------------------------------------------------------------------
    Error :

    Code (Text):
    [14:10:41 ERROR]: Could not load 'plugins\plugintest.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:305) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.reload(CraftServer.java:750) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.Bukkit.reload(Bukkit.java:525) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:634) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:444) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:407) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot.jar:git-Spigot-dcd1643-e60fc34]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
    Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
            ... 14 more
    ------------------------------------------------------------------------------------------------

    My plugin.yml :


    Code (YAML):
    main: fr.dodo.plugin.Main
    name
    : Test
    version
    : 1.0.0
    author
    : Dodo
    description
    : Test

    -----------------------------------------------------------------------------------------------

    My Main.java :

    Code (Java):
    package fr.dodo.plugin;

    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin{
        @Override
        public void onEnable() {
            System.out.println("Le plugin de Test est LancĂ© !");
        }
        @Override
        public void onDisable() {
            System.out.println("Le plugin c'est arretĂ©");
        }

    }

     
  2. Your exported jar doesn't contain your plugin.yml.
    Make sure this is getting included when exporting.
     
  3. How i can do that ?
     
  4. You must've put it in a wrong folder, try puttin it in the src folder or outside of src.
     
  5. when you are exporting the jar to the server, you should see a list of files that will be exported with the jar, make sure that the plugin.yml is in there

    Also, where do you place the plugin.yml in the jar?
     
  6. I place the plguin.yml in src folder in package fr.dodo.plugin
     
  7. Should be plugin.yml

    If none of above works.
    Please tell if you're using maven. If Yes. Then post your pom.xml here too
     
  8. yes it is plugin.yml
     
  9. You need to place it outside of the src folder, so when you open the jar, you see src folder and plugin.yml
     
  10. yes thanks
     
    • Like Like x 1