Solved Failure to find org.bukkit:craftbukkit:jar:1.11.2-R0.1-SNAPSHOT

Discussion in 'Spigot Plugin Development' started by KleinDev, Jun 2, 2017.

  1. Hey There,
    I have an Problem with my IDE (intelliJ IDEA)
    I couldn't use the craftbukkit Maven Repository
    Here the pom.xml File
    Code (Text):
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>

        <groupId>de.minecron</groupId>
        <artifactId>Minecron-Utils</artifactId>
        <version>1.31</version>

        <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>
            <repository>
                <id>inventive-repo</id>
                <url>https://repo.inventivetalent.org/content/groups/public/</url>
            </repository>
        </repositories>


        <dependencies>
            <!--Spigot API-->
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.11.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <!--Bukkit API-->
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>1.11.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>
            <dependency>
                <groupId>org.inventivetalent</groupId>
                <artifactId>particleapi</artifactId>
                <version>2.1.1</version>
            </dependency>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>craftbukkit</artifactId>
                <version>1.11.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>

        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
        </properties>
    </project>

    Here the Error
    [WARNING] The POM for org.bukkit:craftbukkit:jar:1.11.2-R0.1-SNAPSHOT is missing, no dependency information available

    [ERROR] Failed to execute goal on project Minecron-Utils: Could not resolve dependencies for project de.minecron:Minecron-Utils:jar:1.31: Failure to find org.bukkit:craftbukkit:jar:1.11.2-R0.1-SNAPSHOT in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]
     
  2. remove the word craft, its just org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT
     
  3. The craftbukkit jar is not hosted on the repo because it would technically infringe on Mojangs copyright. You have to run BuildTools.jar on your computer, when you do so it will add it to the local repo so you can compile with it.
     
    #3 oskar3123, Jun 2, 2017
    Last edited: Jun 2, 2017
  4. One Problem, I want to use NMS and CraftPlayer
    But "spigot-api" and "bukkit" doesn't contains this..


    Can you tell me how?
    I had run the BuildTools, but how is the craftbukkit dependency in my Project?
    How can I use it?
     
  5. When you run buildtools, a file should pop up in %me%\.m2\repository\org\bukkit\bukkit\1.11.2-R0.1-SNAPSHOT
    I have made a user variable called %me% so i save some time. %me%\ is the user home directory
     
  6. Thank You, I have found the Folder

    And now, I want to intergrate it in my Project..
    I see in the Modules, the craftbukkit.jar is added but not available.
    in the Folder (/home/%me%/.m2/repository/org/bukkit/craftbukkit/1.11.2-R0.1-SNAPSHOT/) are only 3 Files:
    - craftbukkit-1.11.2-R0.1-SNAPSHOT.jar.lastUpdated
    - craftbukkit-1.11.2-R0.1-SNAPSHOT.pom.lastUpdated
    - resolver-status.properties

    But IntelliJ IDEA wants:
    - craftbukkit-1.11.2-R.01-SNAPSHOT.jar
    - craftbukkit-1.11.2-R.01-SNAPSHOT-sources.jar
    - craftbukkit-1.11.2-R.01-SNAPSHOT-javadoc.jar
     
  7. FYI %USER% is a built in variable that goes to that IIRC...
     
  8. It is easy for me to go to user home. I made it last year and it has paid off (especially with most of my workspaces for eclipse in there)
    ME helps.PNG
     
  9. IDK too large 4 me to remember. I had to get that website when I made this RSA encryption project that saved RSA keys in AES/ECM/NoPadding or whatever shit it's put in
     
  10. Is there any way to add the BuildTools manually in the Project?
    Adding an Repository with an URL to the Folder?
     
  11. I can add an external jar to my project
    And now, I can import the classes for NMS
    But one Problem, the compiler doesn't use the external jar, So it gives me an error:
    Today i tried it with the spigot-1.11.2-R.01-SNAPSHOT.jar, because it cointains the "recentTps" Method
    Code (Text):
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Minecron-Utils: Compilation failure: Compilation failure:
    [ERROR] /home/XXXX/Dokumente/Development/Workspace/Minecron Utils/src/main/java/de/minecron/Utils/Events/Movement.java:[3,37] package net.minecraft.server.v1_10_R1 does not exist
    [ERROR] /home/XXXX/Dokumente/Development/Workspace/Minecron Utils/src/main/java/de/minecron/Utils/Functions/TabList/extras/HEADERandFOOTER.java:[7,37] package net.minecraft.server.v1_10_R1 does not exist
    [ERROR] /home/XXXX/Dokumente/Development/Workspace/Minecron Utils/src/main/java/de/minecron/Utils/Functions/TabList/extras/HEADERandFOOTER.java:[9,46] package org.bukkit.craftbukkit.v1_10_R1.entity does not exist
    [ERROR] /home/XXXX/Dokumente/Development/Workspace/Minecron Utils/src/main/java/de/minecron/Utils/Functions/TabList/extras/HEADERandFOOTER.java:[28,28] cannot find symbol
    [ERROR] symbol:   variable MinecraftServer
    [ERROR] location: class de.minecron.Utils.Functions.TabList.extras.HEADERandFOOTER
    [ERROR] /home/XXXX/Dokumente/Development/Workspace/Minecron Utils/src/main/java/de/minecron/Utils/Functions/TabList/extras/HEADERandFOOTER.java:[32,30] cannot find symbol
    [ERROR] symbol:   class CraftPlayer
    [ERROR] location: class de.minecron.Utils.Functions.TabList.extras.HEADERandFOOTER
    [ERROR] -> [Help 1]
     
     
  12. I solved the Problem, here the Solution

    Here is the Repository, change the "[Path to Directory]" to your Directory with the jar files
    Code (Text):
            <repository>
                <id>local-files</id>
                <name>local-files</name>
                <url>file://[Path to Directory]</url>
            </repository>
    Then add these dependency (here I used spigot)

    Code (Text):
          <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.10.2</version>
            </dependency>
     
    Attention!
    Here the Directory-Tree
    [1] --- org
    [2] --- --- spigotmc
    [3] --- --- --- spigot
    [4] --- --- --- --- 1.10.2
    [5] --- --- --- --- --- spigot-1.10.2.jar
    because the groupId in the dependency is org.spigotmc
    So it switch to the following directories "org" and than "spigotmc"
    Your artifactId is spigot, so it switch from the directory "spigotmc" in "spigot"
    your version is 1.10.2, it switch from "spigot" to "1.10.2"
    It search for a jar file with the Name "spigot-1.10.2.jar" because the ArtifactId is "spigot" and the version ist "1.10.2"

    ~ Sorry 4 my bad Englisch, im a german human with non-perfect Englisch