Maven in general, and then protocolLib specifically

Discussion in 'Spigot Plugin Development' started by torpkev, Sep 24, 2019.

  1. I've been using maven for a little while and tend to do ok so long as there are fairly strict instructions for a plugin I might want to pull in, but I'd appreciate a bit of knowledge from people smarter than me.

    I have a plugin on Spigot that I'd like to pull in - right now I'm just pointing the systemPath to it, and that works, but isn't ideal. Is there some repository that has the plugins on Spigot?
    Code (Text):

    <dependency>
        <groupId>work.torp</groupId>
        <artifactId>Myriad</artifactId>
        <version>1.0.1</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/MyriadClans_1_0_1.jar</systemPath>
    </dependency>
     

    How difficult is making my own repository and pointing to it if I can't access them directly from Spigot?

    How do I point to the dev builds of ProtocolLib? Right now I'm having to use the dev builds for 1.14.4, but the dev build is a 4.5.0 snapshot and the ProtocolLib repo only seems to have up to 4.4?

    Code (Text):

    <repository>
        <id>dmulloy2-repo</id>
        <url>http://repo.dmulloy2.net/content/groups/public/</url>
    </repository>
    ..
    <dependency>
        <groupId>com.comphenix.protocol</groupId>
        <artifactId>ProtocolLib-API</artifactId>
        <version>4.4.0</version>
    </dependency>
     
    2019-09-24 14_49_20-Maven - Nexus Repository Manager.png

    Any help would be appreciated!
     
  2. You can't get a plugin from Spigot using a "spigot repository" and you SHOULDN'T post other peoples projects on your own repository. If they don't have a repo setup you can ask them to do so, but if no movement happens you're stuck with the systemPath way.

    The protocollib repo is currently down so I can't check, but it seems you'll have to use the systemPath way for the dev builds of protocollib aswell.
     
  3. Thanks. To clarify, the my own repository question is for MY plugins, not other peoples.
     
  4. The word "shouldn't" only applies when the repo is going to be public, if you set it up for usage only on your own computer then that should be completely fine, in fact it's the only proper way to add non-Maven artifacts.
    Also some public Maven repository managers automatically download and cache artifacts from other repos into inside themselves.
     
  5. Your machine has a local repository under C:/user/.m2/, you may use maven install:file to locally install something to your said repo.

    Regarding ProtocolLib, the public facing implementation is abstracted. You most likely will not need to access the latest version of it. If the server plugin jar is updated to the latest version the internal implementation also changes. I never had issues with mismatching maven versions using protocollib