[SOLVED] Trouble setting up new Bukkit/Spigot plugin

Discussion in 'Spigot Plugin Help' started by PureTryOut, May 28, 2015.

  1. So i'm new in all of this. I'm trying to set up a new Bukkit/Spigot plugin project in Eclipse.
    I've installed Maven, made the basic plugin files using this tutorial. However, i'm stuck with creating the first class file.
    "The import org.bukkit.plugin.java.JavaPlugin" can not be found. It also gives "JavaPlugin can not be resolved to a type".

    After some digging I found this video which tells me I have to build the Maven project with "clean install" as goal. Doing that fails in not being able to resolve the dependencies.
    I have the following in pom.xml, partly taken from here:
    </repository> </repositories>
    </dependency> </dependencies>

    I changed it around quite a lot already but it won't work. From what I understand the correct dependencies are not in the repository as it has copyright issues (I know most of the story, no need to explain it here). I however have no clue how to use my own jar I build with BuildTools.jar...

    What can I do about this so I can start experimenting with writing a plugin?
    #1 PureTryOut, May 28, 2015
    Last edited: May 28, 2015
  2. Have you added the spigot jar to your build path?
  3. Well like I said, I have no idea how to do that.
  4. Sorry misread your post there, if you go to your project in eclipse in navigation and then right click it, then go to Build Path > Configure Build path, this should then open another window, when here click the add external jar button and then browse to your spigot jar and add it. Also when you have added the jar if you expand it there should be a javadoc location option, click on this and then click edit and put this url as the location https://hub.spigotmc.org/javadocs/spigot/
  5. Your spigot repo's url is wrong I assume.
  6. Thanks that did the job. Can I just remove the repository and dependency stuff out of pom.xml?
  7. Yeah you don't really need that tbh...
  8. Some new information. I eventually managed to build the plugin fine using the dependency information in pom.xml, however only if I specify 1.8.5-R0.1-SNAPSHOT, so not 1.8.6. The files are located in the repo.
    Any clue why it can resolve 1.8.5 and lower, but not 1.8.6?
  9. Never mind I just had to clear my cache. Fixed.
  10. Sorry, didn't see your reply before there, glad you fixed it. :D