Configure remapping for NMS modules that depend on each other
mainIf you have multiple NMS modules that depend on each other and will be shaded into a single JAR (and you are using remapping), you must change the remapping strategy to avoid issues with shaded dependencies.
Scenario: Module api uses NMS and provides interfaces. Module plugin implements these and shades api.
Required Configuration:
- In the
apimodule: Remove the<executions>block from thepaper-nms-maven-pluginconfiguration so it does not attempt to remap the individual module. - In the
pluginmodule:- Change the
remapgoal to run during thepackagephase (instead ofprocess-classes). - Ensure the
paper-nms-maven-pluginis positioned after themaven-shade-pluginin your<plugins>list.
- Change the
This ensures the plugin remaps the final shaded JAR file, including all shaded NMS dependencies.