Prerequisites
- Java 8 or higher
- Maven or Gradle build system
- Basic knowledge of Minecraft plugin development
Maven setup
Add JitPack repository
Open your
pom.xml and add the JitPack repository to the <repositories> section:Add Foundation dependency
Add Foundation to your
<dependencies> section. Replace REPLACE_WITH_LATEST_VERSION with the latest version from GitHub releases:Check github.com/kangarko/Foundation/releases for the latest version number.
Configure maven-shade-plugin
This step is critical! Foundation comes with optional dependencies (WorldEdit, ProtocolLib, etc.) that will be included in your jar if you don’t configure shading properly.Add this to your
<plugins> section. Replace your.plugin.main.package with your actual package name:Gradle setup
Add Foundation dependency
Add Foundation to your dependencies. Replace
REPLACE_WITH_LATEST_VERSION with the latest version:Shading additional libraries
If you need to include other dependencies in your plugin jar:Maven
Add the dependency withcompile scope and include it in the shade plugin:
Gradle
Verifying installation
After building, verify your setup:- Check that your jar file size is reasonable (not bloated with unnecessary dependencies)
- Extract your jar and verify only Foundation is in the shaded package location
- Test your plugin on a server to ensure it loads correctly
A properly configured Foundation plugin jar should be relatively small. If your jar is over 50MB, you likely have unnecessary dependencies included.
Next steps
Quick start guide
Create your first plugin with Foundation
Migration guide
Upgrade from JavaPlugin to SimplePlugin
Troubleshooting
Build fails with “package org.mineacademy.fo does not exist”
Ensure JitPack repository is added and you’re using the correct version number from GitHub releases.Jar file is too large
You haven’t configured shading properly. Review the<includes> section in your shade plugin configuration to ensure only necessary dependencies are included.
NoClassDefFoundError at runtime
You may have excluded Foundation from shading. Verify Foundation is listed in your<includes> or shadow configuration.
Conflicts with other plugins
Ensure you’re relocating Foundation to your plugin’s package using the<relocations> configuration.