Discussion in 'Spigot Plugin Development' started by bys1, Jun 9, 2017.

  1. Hi,

    I'm using the SpigetDownloader API by @inventivetalent in one of my plugins.
    The problem is that after shading it in my plugin size is 8 MB.
    Since @inventivetalent didn't reply to my conversation, I'm asking it here: Is there any way to use the spigetdownloader without having an 8 MB file (no I wouldn't want the user to install the SpigetDownloader as plugin) or is there any alternative to SpigetDownloader? I'd like to have my file size 150 kb at max.
  2. Mas


    Another option is to add the jar as a dependency, place the jar into a "libs" folder in your server directory, and modify your server starting program with the classpath flag so as to load all jars in the libs folder at runtime.
  3. Good lord, why on earth does it need 15MB of dependencies? Why is Jetty in there?? That's a webserver, doesn't seem like you'd need that just to download stuff.

    The actual code is pretty minimal, though I didn't look that closely nor look at SpigetClient - but if all this is doing is downloading a file I don't think you even really need an API for that :\
  4. You could use an external plugin for it to load jars you need at runtime.

  5. It'd be nice if @inventivetalent could reply...
  6. Assuming you're talking about https://github.com/InventivetalentDev/SpigetDownloader then, unfortunately, there is no easier way to download files from spigotmc.org.

    If it was that easy to access spigotmc.org, there also wouldn't be the need for something like Spiget.

    If you can be bothered to look for dependencies that are shaded unnecessarily, then feel free to do that. I simply can't be bothered to do it, which is one of the reasons it's on GitHub.
    • Informative Informative x 1
  7. https://github.com/SpiGetOrg/SpigetClient/blob/master/pom.xml
    Need to set <scope>test</scope> on junit, it's likely being shaded because its scope is not being restricted.

    You are also importing jetty but I can't find any use of it.
    • Informative Informative x 1
  8. Choco


    Any reason you're not just making web requests to SpiGet's RESTful API? You then don't require any dependencies whatsoever. It's not difficult to do, especially with GSON being a thing...
    • Like Like x 1
  9. I am making a plugin installer too. With web requests I can only download the newest version of a resource, but I want users of my plugin to be able to download older versions too.