How to deploy a custom build of a core plugin bundled in Jenkins?
According to the writers of that documentation, you need to copy your .hpi file to
$JENKINS_HOME/plugins, remove the plugin's development directory, and finally create an empty file called .hpi.pinned for maven to use. Then you should be ready to restart Jenkins and use your custom build of a core plugin.
They also suggest running
mvn clean when you're ready to update Jenkins to remove old files (after changing core plugins, old .jar files might still be around after updating).