Solved Failure to find bukkit.jar:1.9-R0.1-SNAPSHOT while trying to depend Vault.

Discussion in 'Spigot Plugin Development' started by VergilPrime, Mar 11, 2018.

  1. I'm new at this and have a good grasp of programming in C# but not Java yet.

    I'm using these guides: https://www.spigotmc.org/wiki/spigot-plugin-development/

    I want to include basic vault permission checks to my plugin, I'm not concerned with whether it's a hard or soft dependency yet but it does need to support vault.

    I added the following to my pom.xml:

    Code (Text):
        <repositories>

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

            <repository>
                <id>vault-repo</id>
                <url>http://nexus.hc.to/content/repositories/pub_releases</url>
            </repository>

        </repositories>

        <dependencies>

            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.12.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>net.milkbowl.vault</groupId>
                <artifactId>VaultAPI</artifactId>
                <version>1.6</version>
                <scope>provided</scope>
            </dependency>

        </dependencies>
    However, when I try to build I now get:

    I also added depend: [Vault] to my plugin.yml

    Failure to find org.bukkit:bukkit:jar:1.9-R0.1-SNAPSHOT in https://hub.spigotmc.org/nexus/content/repositories/snapshot/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced
     
  2. IMO dont mess with the overcomplicated mess that is Maven until oyu are solidly familiar with java and how dependancies work.

    If you want to do anything serious with spigot beyond the basic API (and you will) you need to download buildtools and build the version you are using locally.
     
  3. I have built the version I am using which is latest as of yesterday, but it appears that vault is stuck firmly in like 2016?
    Also, Maven is one of those magical things I don't understand. Isn't it standard to use it now?
     
    • Funny Funny x 1
  4. Avoid magical things you dont understand until you can understand them, really. Saves trouble.

    I dont know about vault, specifically.. Nothing newer? It should be forward compatible to a degree.
     
  5. Vault's a trainwreck with it's maven servers.

    I recommend you just have Vault as a local lib at this point.

    Like this:

    Code (Text):

            <dependency>
                <groupId>net.milkbowl.vault</groupId>
                <artifactId>Vault</artifactId>
                <version>1.5.6</version>
                <scope>system</scope>
                <systemPath>${project.basedir}/lib/Vault.jar</systemPath>
    </dependency>
    And then just have a copy of Vault.jar in (YourCodeRepo)/lib/

    It's an awkward solution but it's the simplest way to support a dependency that you can't reliably get from a maven server.
     
  6. I don't really agree. Figuring out things that seem magical is a solid way to learn.
     
  7. I'm confused, your telling it to look for 1.12, why would it find 1.9?
     
  8. because Vault was built against 1.9 and Vault hasn't been updated since august 2016
     
  9. I've had success with the following pom configuration

    Code (Text):
     
        <repositories>
            <repository>
                <id>spigot-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
            </repository>
            <repository>
                <id>vault-repo</id>
                <url>http://nexus.hc.to/content/repositories/pub_releases</url>
            </repository>
        </repositories>
        <dependencies>
            <!--Spigot API-->
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.12.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <!--Bukkit API-->
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>1.12.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <!-- Vault API -->
            <dependency>
                <groupId>net.milkbowl.vault</groupId>
                <artifactId>VaultAPI</artifactId>
                <version>1.6</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
     
    However, I don't know the side effects of depending on the Bukkit API into your project or any plugin for that matter. I haven't had a problem with it personally but I'd proceed with caution