Solved How to add com.mojang.authlib maven

Discussion in 'Spigot Plugin Development' started by tryce05dev, Jan 26, 2020.

  1. That really doesn't help, i know how to add spigot api dependency, i just don't understand how to import the kar file while building with spigot...
     
  2. FrostedSnowman

    Resource Staff

    You don’t import any kind of jar. You setup your dependencies through maven. There are tutorials and videos online you can view for this. The link I provided provides you with the dependencies you need to specify in your pom.xml
     
    • Like Like x 1
  3. The pictures do not work. Also, you need to setup your pom.xml to be able to use spigot
     
  4. I know how to use pom, and i know how import spigot and such, i just don't know how to import
    com.mojang.authlib
     
  5. FrostedSnowman

    Resource Staff

    you need to depend on the singular 'spigot' dependency (the artifact id)

    if you want to access such classes:

    Code (XML):
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
     
  6. You will need to find the repo for the com.mojang.authlib dependency if you want to use it through maven, or add the jar to your local repo
    Though what would you need authlib for on a server..?
     
    • Like Like x 1
  7. Making sure that the auth servers are up and running? :ROFLMAO::ROFLMAO:
     
  8. iirc the customNPC plugin uses that to get skins n stuff
     
  9. https://mineskin.org/
    Alternative way: gameprofiles
     
  10. relying on 3rd party websites of questionable lifespan isnt the best solution imho
     
  11. Idk if im dumb, but where do i use the
    Code (Text):
    mvn install:install-file \
       -Dfile=<path-to-file> \
       -DgroupId=<group-id> \
       -DartifactId=<artifact-id> \
       -Dversion=<version> \
       -Dpackaging=<packaging> \
       -DgeneratePom=true
    from https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project?
    Like where do i use the command

    EDIT:
    I found out i used:
    Code (Text):
    <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot</artifactId>
                <version>1.0</version>
                <scope>system</scope>
                <systemPath>${project.basedir}/src/main/resources/spigot-1.8.8-R0.1-SNAPSHOT-latest.jar</systemPath>
            </dependency>
    Thanks for helping guys!
     
    #13 tryce05dev, Jan 27, 2020
    Last edited: Jan 27, 2020
    • Like Like x 2
  12. Wait, now the file is huge, but it works...
     
  13. I know this is an old thread but it still shows up on google's search results when you search for this issue. I had the same problem and I've found the solution, add this to your pom.xml:

    Code (Text):
    <repositories>
            <repository>
                <id>minecraft-repo</id>
                <url>https://libraries.minecraft.net/</url>
            </repository>
    </repositories>
    <dependencies>
            <dependency>
                <groupId>com.mojang</groupId>
                <artifactId>authlib</artifactId>
                <version>1.5.21</version>
                <scope>provided</scope>
            </dependency>
    </dependencies>
    Note that you might need to change the version depending on the MC version
     
    • Useful x 5
    • Winner x 2
    • Like x 1
    • Agree x 1
    • Friendly x 1