How do I Maven Shade into my Maven Project?

Discussion in 'Spigot Plugin Development' started by TheSpyguy16, May 17, 2018.

  1. Hello, Spigot Members!

    I know their is maven and utils APIs out there, but some have it were users have to download their API plugin to their server for the features to work in your plugin. My question is that is there a way to not do that. Because I have actionbar and titlebar feature in one of my plugins, but people or server owners need that plugin for them to work. I do know I can make the code for a ActionBar and TitleBar, but I tried and does not work.

    I don't want server owner's or users to not do a extra step just to get a extra feature to work!
    #1 TheSpyguy16, May 17, 2018
    Last edited: May 17, 2018
    • Informative Informative x 1
    • Informative Informative x 1
  2. Some people don't like the newer versions due to combat changes and that's why they stay on 1.8. Therefore, for this reason that's why I support 1.8 and up.
  3. Yes I understand all the combat changes, but 1.8.8 development is a pain in the ass imo. But we all do it anyway xD
    • Agree Agree x 1
    • Informative Informative x 1
    • Useful Useful x 1
  4. So how do I maven shade? For example shade this plugin (TTA) into my maven project.
  5. Don't shade it in. You don't know what plugins a server might be running as well as yours. They may have other plugins that depend on the API plugins you are shading and it will just cause conflicts.
    Use plugin.yml to set the API plugin as a dependency, and let the server admin add it to the server as necessary.
    Any decent server admin won't mind the extra step.
  6. You need to set the dependency’s scope to compile and add the maven shade plugin under the build section in your pom.xml. The examples provided are the bare minimum required and does not cover relocation of classes, the only changes required is to substitute guava’s dependency information with TTA’s which can be found on it’s plugin page.

    There’s always the option to relocate the classes/packages which would prevent conflicting dependencies.

Share This Page