Why Publish Locally?
Publishing to Maven Local is useful when you:- Are developing a Paper API feature or fix
- Want to test API changes before they’re released
- Need to verify your plugin works with upcoming Paper versions
- Are contributing to the Paper project
Publishing Paper to Maven Local
Apply patches
Apply the Paper patches to prepare the source:This applies all Paper modifications to the Minecraft source files.
Using the Local Paper API
After publishing, configure your plugin to use the local Maven repository.Gradle Configuration
AddmavenLocal() to your build.gradle.kts:
build.gradle.kts
Gradle checks repositories in declaration order. Place
mavenLocal() before the Paper repository to ensure your local build is used instead of the published version.Maven Configuration
Maven automatically checks the local repository (~/.m2/repository/) before remote repositories, so no configuration changes are needed. Just ensure your dependency version matches the locally published version:
pom.xml
Important Considerations
Remove
mavenLocal() when finished testing.Using Maven Local in production builds can cause issues:- Builds become non-reproducible on other machines
- CI/CD pipelines may fail
- Team members may get different versions
Cleaning Up
To remove the locally published Paper API:Linux/macOS
Windows
Development Workflow
Here’s a typical workflow when developing with local Paper changes:Troubleshooting
Changes not appearing
If your plugin doesn’t pick up local changes:- Verify the version numbers match exactly
- Run
./gradlew clean buildin your plugin - Check that
mavenLocal()appears before other repositories - Ensure you ran
publishToMavenLocalafter making changes
Build cache issues
Gradle may cache dependencies. Force a refresh:WSL2 Performance
If building on Windows is slow, use WSL2 for significantly better performance. See the Paper CONTRIBUTING.md for setup instructions.Next Steps
Once you’ve verified your changes work:- Submit a pull request to the Paper repository
- Follow the contribution guidelines
- Wait for the changes to be merged and released
- Update your plugin to use the official release