Importing Essentials/Factions from Github

Discussion in 'Plugin Development' started by vtg_the_kid, Jul 29, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    vtg_the_kid

    Hello.

    I would like to import plugins from github onto eclipse so I can make them work better with my private server.

    I know how to import projects from Github, and have successfully imported floAuction, edited it, and put a working version onto my server. However, this isn't working for factions or essentials.

    When I imported Essentials onto eclipse, I used the url: https://github.com/essentials/Essentials.git. I selected all the branches. However, when I try to import existing projects, only EssentialsGroupManager shows up. For factions, no existing projects show up for me to import.

    [​IMG]
    How would I fix this? Thank you so much.
     
  2. Offline

    mythbusterma

    @vtg_the_kid

    You're going to have a very rough time doing it that way. Try building against the already compiled .jar file, that should cause you significantly less grief, even if you can't see the source code.
     
  3. Offline

    vtg_the_kid

    @mythbusterma

    Thanks for the reply!
    I'm not sure what you mean by "building against the already compiled .jar file". How would I do that, and would I still be able to edit the source code that way?
     
  4. Offline

    mythbusterma

    @vtg_the_kid

    Why do you need to change the source code?
     
  5. Offline

    vtg_the_kid

    I like to make the stuff on my server all the same color, and all the same style.
     
  6. Offline

    mythbusterma

    @vtg_the_kid

    Well if you're really that bent on doing so, you're going to need to install Apache Maven. I would also recommend cloning the repository from the command line and running Maven the same way. Maven will handle the dependencies and building of the .jar file.
     
    vtg_the_kid likes this.
  7. Offline

    vtg_the_kid

    @mythbusterma

    Thanks, I will try that later.

    Do I really have to use another method though? I did get my method to work for floAuction. Does anyone know why this doesn't work for Factions or Essentials?
     
  8. Offline

    mythbusterma

    @vtg_the_kid

    Because they rely on Maven. You could also resolve their dependencies yourself, but that would be a waste of time and resources.
     
  9. Offline

    vtg_the_kid

  10. Offline

    SuperOriginal

    Research git cloning, it's as simple as one command. I don't use Eclipse but I'm assuming there's an easy way to get projects imported after that
     
  11. Offline

    vtg_the_kid

    @SuperOriginal
    I cloned successfully.
    I can't import because no projects show up in the "select projects" section in eclipse, like I showed in my original post.
    I have researched for 3 days and found countless useless links.
    The solution I found only worked for floAuction, and not complicated plugins like Factions.
    I noticed that the "src" folder in Factions was named "src/main", so maybe eclipse didn't understand that?
    Also the working git repository had a ".settings" file, and the unworking ones didn't...
    Does anyone know what's going on.

    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 11, 2016
  12. Offline

    Synapz

    Importing a project for me through Eclipse import has never really worked for me. Instead what I do is clone onto onto my Desktop, drag and drop it into my workspace, open Eclipse and make a new Java Project with the same name as the cloned folder and hit create. From there it loads the classes and files automatically from the folder. Hope this helps? I know what maven is, however Ive never used it. Try it, it might work!

    P.S - If your server is on 1.8, dont edit Essentials because its last update is outdated. Instead try this... http://dev.bukkit.org/bukkit-plugins/essentialsx/. Its Essentials just updated, with fixes and improvements. Plus it has a GitHub (it was forked from Essentials) so you can clone it also.
     
    Last edited: Aug 1, 2015
    vtg_the_kid likes this.
  13. Offline

    vtg_the_kid

    @Synapz

    I truly appreciate your answer. It's kinda late for me right now, so I have to go to bed. I'll try it out tomorrow and let you know if it works!

    Thank you so much!! :D
     
    Synapz likes this.
  14. Offline

    Gater12

    @vtg_the_kid
    Well what I use to import maven projects from git is the Maven plugin for Eclipse and used
    Import > Maven > Check out Maven Projects from SCM and installed git SCM connector.

    Then I just input the url and off it goes.
    Note it will be imported as a regular Maven project.
     
    vtg_the_kid likes this.
  15. Offline

    vtg_the_kid

    @Synapz

    So I tried your method, and it mostly worked.

    "SpawnerProvider cannot be resolved to a type".

    For some reason, a bunch of packages didn't get imported, they were from net.ess3.nms.

    When you do your method and create a project in eclipse, do you have 0 errors every time? I can't get Essentials (the one you gave me) to compile. If I forcefully compile it (delete all the stuff with errors/add missing stuff) I can't run the plugin. Also, what is in your build path for essentials?
     

    Attached Files:

    Last edited: Aug 2, 2015
  16. Offline

    Synapz

    @vtg_the_kid

    I wouldnt say everytime I had 0 errors. But I if I do it is most likely missing dependencies. Maven is used to easily get those dependencies however we are just forcing it into your IDE unknowing its dependencies.

    Btw this is a good example to show what Maven is because it took my a while to understand... Imagine having a plugin with like 15 different APIs... Now imagine cloning that then having to track down each API and import it, Maven automates all that.

    Maven has whats called a "pom" file to store all these dependancies. And essentials one is here, https://github.com/drtshock/Essentials/blob/2.x/Essentials/pom.xml. If you look in it for the
    <dependencies> tag in its body is a bunch of dependancies. For example Vault is in its body labeled
    <artifactId>Vault</artifactId>. You have to manually import all of these in order to get the errors away. My method is good for small projects but essentials is giant and I didnt relize sorry... But you can manually install them I guess, best way would use maven.

    P.S - I just found this on Essentials GitHub main page
    "To build with Maven, use the command

    mvn package dependency:copy
    Jar files can then be found in the /jars folder" that should give you all its dependancies.
     
Thread Status:
Not open for further replies.

Share This Page