Eclipse exporting

Discussion in 'Spigot Discussion' started by Atlanta, Apr 16, 2017.

  1. Hello!

    So basically when I downloaded source from github I made everything good so I added every dependency and plugin had no errors but when I export plugin , dependencies are not exported with plugin itself.
    Errors that I have:
    Order and export settings:

    So if anyone know how to fix the dependencies to be exported with project , please HELP ASAP!
     
  2. Dependencies don't export with a jar. If you want to export dependencies too, you will have to either:
    A) Get the sources of all of the dependencies and put them inside your src
    B) Use maven [the best possible choice]
     
  3. How do I use maven sorry I know I am dumb but please help me somehow :/
     
  4. First you go to apache's home page and find maven. download the latest version which i think is 3.9.9. Beware, it's very big.
    Then you make a folder in C:\Program Files\ called Apache Software Foundation.
    In there you copy the stuff from the zip file you downloaded.
    Then go to control panel > System and Security > System and look for the thing that says Advanced System settings.
    Press Environment variables.
    In system variables you should already have your jdk in the path, but you also need a system variable called JAVA_HOME and it should go to the JDK's bin (If your using JDK1.8.0_121 the JAVA_HOME thing would be C:\Program Files\Java\jsk1.8.0_121\bin (x64))
    Now make a system varable called MAVEN_HOME. Make it go to where your maven stuff is. It would be C:\Program Files\Apache Software Foundation\apache-maven-3.3.9
    Now make another one called M2_HOME and make it go to %MAVEN_HOME% This one is for your buildtools to run on
    How edit your path to have maven (be careful your path is very important)
    If you get a GUI when you try edit path, just press new and add %MAVEN_HOME%\bin
    If you don't get one, go to the end of the text and if there is a semi colon, don't add one. If there isn't add one
    type %MAVEN_HOME%\bin and edit it with a semi colon. save your path and there should be no restarts needed.

    To check your install open cmd.exe and type mvn and it should say something (probably an error)

    Now on converting a project...

    Install m2e eclipse plugin.
    Right click on your project and go down to configure. Press convert to maven project.
    Find all the dependencies you need. For spigot-api see below
    Add the dependencies to your pom.xml and set scope to compile
    Remove from your old build path thing.
    When your done, right click your project,go down to Maven and press refresh.

    For spigot add a repo with url

    <repository>
    <id>spigot-api</id>
    <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>

    and the actual dependency
    <dependency>
    <groupId>org.spigotmc</groupId>
    <artifactid>spigot-api</artifactid>
    <version></version>
    </dependency>

    to find the version go to https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/ and look for the latest version