Import from github

Discussion in 'Spigot Plugin Development' started by Nighterance, May 11, 2017.

  1. Hello!
    So I am trying to import a plugin from github, I tryed with import as git, it worked, but it could not locate main class ( I tryed to clean project). Then I tryed to import it as maven, but there were 500 errors, since I did not have all dependencies, but it should have installed them automatically. Maybe I am doing something wrong? Thanks!
     
  2. If you are using Maven for dependencies in your plugins, you use this. JitPack lets you use GitHub repositories as Maven dependencies. If the resource you are trying to use already has a dedicated Maven repository, then use that, however, if there is no Mave repository, then you can use JitPack.
     
  3. But the thing is that I can't. If I import as maven then it comes with errors about dependencies, and I am unable to get all of them, since there are a lot of.

    If I try to get from git hub, then It gets dependencies, but does not work for some reason. I will look into JitPack but still waiting for answers.
     
  4. Choco

    Moderator

    Let's just clarify something real fast. Are you trying to take an open-sourced project from GitHub and load it into your IDE in order to edit it? Or are you trying to use that project as a Maven dependency for another personal project?
     
  5. Open Source project to load & edit
     
  6. If you just want to edit an already existing, open source repository, then just clone the repository using Git. The popular Java IDEs all have their own built in source control to clone GitHub repositories.
     
    • Agree Agree x 1
  7. Gaxan

    Supporter

    are you trying to run it as an application or build it from a clone?
     

  8. I cloned it, tryed exporting, it could not locate main class ( i even tryed to create new java project and copy paste, still nothing new ), my best guess, it for some reason does not export it ( altough on export there is checked!)
     
  9. Well you have to define the project characteristics after you clone it. No IDE out there knows which class is the main class just from cloning. You might have to tweak the project structure or plugin.yml.
     
  10. The main class will be the one that extends JavaPlugin. As Hunky524 mentioned you can look in the plugin.yml ( example: main: me.tarluin.Home.Home)
     
    #10 Tarluin, May 11, 2017
    Last edited: May 11, 2017
  11. I know that, and there is already path to a main class, that extends javaplugin.

    Any tutorials or more information about this?
    Thanks!
     
  12. KoTH
    https://github.com/SubSide/KOTH

    I jus looked auther just advised me something as well, will try with his way.