Solved IntelliJ compiling plugin to be over 44MB!

Discussion in 'Spigot Plugin Development' started by DecisionsYT, Aug 10, 2018.

Thread Status:
Not open for further replies.
  1. Hey! I have a plugin that SHOULD be no more than 1 or 2 MB (And that's high)

    When I am on IntelliJ, I do Build > Build Artifacts > Build. I believe when it is compiling, it's including my Spigot 1.13 version aswell because the file size is a few KB more than my spigot build itself.

    How do I stop it from compiling with the Spigot build (If I'm right about that being the issue.)

    My project structure is: http://prntscr.com/kh5cze

    Thanks.
     
  2. See that you don't shade your dependencies into the jar.
     
  3. You should package your project, not build the artifact (I was confused when I noticed the difference, too). I'm not sure of otherwise, but when you use Maven, there's a little menu of the right side of the IDE that simply says "Maven Project" and allows you to package your project if you go into that, lifecycle, package.
     
  4. Go into your project settings and make sure it's not extracting spigot into the final jar. Also I would recommend using either Maven or Gradle
     
  5. You only have to build your code, you are compiling spigot within the jar.
    Better solution: Use Maven
     
    • Like Like x 1
  6. How would I go about using Maven. Where do I enable it in my project?
     
  7. You've never run BuildTools then.
     
  8. You are likely shading your spigot jar, which would make sense because the spigot jar is about 42 MB, which would make a 44 MB plugin if your plugin is 2 MB.

    Make sure your jar type is provided.

    EDIT: Also, you need the OSS repository to download spigot.
     
  9. I've just installed BuildTools. What should my next step be?
     
  10. Well, if you run build tools you build 1.13 which is then added to your local Maven repository.
     
  11. Thank you everyone for your help. I just had to restart IntelliJ after installing Buildtools for it to recognise that I had installed it.
     
Thread Status:
Not open for further replies.