Solved NMS Maven dependency

Discussion in 'Spigot Plugin Development' started by JackboyPlay, Apr 14, 2017.

Thread Status:
Not open for further replies.
  1. If I try to import a nms thing, it wont work, which thing should I use as an dependency to import nms things?
    My dependencies:
    Code (Text):

    <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <!--Bukkit API -->
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>2.6.0</version>
            </dependency>
     
     
  2. In your dependencies your have spigot-api and bukkit, and they only contains the api, not the implementations (so it doesn't contains NMS code).
    You can have NMS in your dependencies by adding craftbukkit to your dependencies (as described here).
     
    • Like Like x 1
  3. I've added this:
    Code (Text):

              <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>craftbukkit</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
     
    But it says: Missing artifact org.bukkit:craftbukkit:jar:1.8.8-R0.1-SNAPSHOT
     
  4. Senmori

    Senmori Retired Resource Staff
    Retired Patron

    Code (Text):
    <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>Version-goes-here</version>
    </dependency>
     
    • Like Like x 1
    • Winner Winner x 1
  5. Added this:
    Code (Text):

    <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.8-R0.1-SNAPSHOT</version>
            </dependency>
     
    But shows the same.
     
  6. There is no craftbukkit artifact in the spigot nexus repo. just go look at this. But you can (i haven't tested it though) put the actual server jar in
    %USERPROFILE%\.m2\repository\org\bukkit\ and make a folder called craftbukkit and in it make a folder called |the version| and in there put the jar but rename it |artifactid|-|version|.jar

    I happen to have the craftbukkit folder already in there with the files. ;)
     

  7. How about running buildtools it'll install the artifacts.

    With 1.8.x your fucked.
     
  8. Oh yeah run buildtools every 2 weeks lol
     
    • Like Like x 1
  9. You can also download craftbukkit source from stash and compile it. Simples
     
    • Like Like x 1
Thread Status:
Not open for further replies.