#Hey I m having problems in creating a

1 messages ยท Page 1 of 1 (latest)

finite niche
rocky trellis
#

How are you compiling the plugin?

finite niche
#

AH

#

using the maven screen on vscode

rocky trellis
#

Paste your pom.

tight wyvern
#

is the plugin.yml in src/main/resources?

finite niche
#

yes

tight wyvern
#

if you decompile that jar file with smth with winrar, is the plugin.yml there?

rocky trellis
#

Apparently not according to the stacktrace.

tight wyvern
#

or just make it a zip

finite niche
rocky trellis
#

Wtf is this. lol

finite niche
#

auto generated

rocky trellis
#

By?

finite niche
#

vscode

rocky trellis
#

Yikes. 1 sec

finite niche
#

yea the plugin.yml isn't in the .jar file

tight wyvern
#

are you building with mvn package?

#

well no idea why that would be an issue but whatever

rocky trellis
finite niche
rocky trellis
#

Idk what kinda crack vscode is smoking, but whatever it is, ain't cutting it.

finite niche
#

๐Ÿ˜„

rocky trellis
#

Try using the pom I sent and just adjust the fields that need modifying.

finite niche
#

umm its still telling me the same error. i checked whether the .jar file contains plugin.yml and it still doesn't

rocky trellis
#

Also, for future reference, the wiki has a tutorial for maven projects with IntelliJ. Although a different IDE, maven is still maven at the end of the day. You might want to read up on that to get an idea on how the pom should be setup. https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/

#

Can you screenshot your project structure?

#

?img

#

Wait, do commands not work in threads?

finite niche
#

from vscode?

rocky trellis
#

Yea, just want to confirm something.

finite niche
#

how do i paste an image here? :''D

rocky trellis
#

You have to be verified. Otherwise you can paste imgur or lightshot links.

#

Oh wait. I just realized that you already said that at the start. ๐Ÿ’€

I can read. I promise. :3

#

Also, what does your plugin.yml currently look like?

finite niche
#

heres the structure

#

plugin.yml is just main: com.testiplugin.App name: demo version: 0.1

rocky trellis
#

Hmm, it's hard to tell off of that screenshot, mainly due to how vscode formats directory collapses, but it looks like your have the resources folder in the wrong location. The resources folder should be under the /main directory. It should fit alongside the /java directory.

finite niche
#

you are right

#

how didnt i realise this sooner :d

#

now im getting a different error when starting the server. https://paste.md-5.net/qenasuguri.md
"org.bukkit.plugin.InvalidPluginException: main class `com.testiplugin.App' does not extend JavaPlugin"

#
package com.testiplugin;

import org.bukkit.plugin.java.JavaPlugin;


public class App extends JavaPlugin {
   
    @Override
    public void onEnable() {
        getLogger().info("Hello, SpigotMC!");
    }

    @Override
    public void onDisable() {
        getLogger().info("See you again, SpigotMC!");
    }
}
rocky trellis
#

You might have to specify the maven build plugin version.

finite niche
#

you got any recommendations for the version?

rocky trellis
#

Latest version is always recommended.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.10.1</version>
    <configuration>
      <source>16</source>
      <target>16</target>
    </configuration>
</plugin>
finite niche
#

where am i supposed to put that exactly? im only getting [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-parseable POM m:\KillaMC\testPlugin\demo\pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ...<plugin>\r\n \r\n <groupId>... @18:18) @ line 18, column 18

rocky trellis
#

Plugins go under the build section of the pom.

<build>
  <plugins>
    <!-- Plugins go here -->
    <plugin>
    </plugin>
  </plugins>
</build>
finite niche
#

now im getting \demo\pom.xml: Unrecognised tag: 'plugin' (position: START_TAG seen ...</properties>\r\n\r\n <plugin>... @20:11)

#

oh nvm the last one

finite niche
rocky trellis
#

What's your project structure look like now?

finite niche
rocky trellis
#

You may also need to include this in your build section.

<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <includes>
          <include>plugin.yml</include>
        </includes>
      </resource>
    </resources>
finite niche
#

I cracked it