Source Code Customization
This is roughly the process that we currently use to create a customized midPoint code:
We "fork" complete midPoint source code into a new repository (either on github or in private repository with git pull/push).
We try to keep all custom code is the components that are under the "custom" subdirectory. This subdirectory is currently mostly empty, it just has some placeholder pom.xml. So you can create a new component custom/my-extensions-impl and place the extension code there. Set up the component pom.xml and the custom/pom.xml and the custom component will be built into midPoint. As all the code is in the custom/\* part of the source code and we usually do not modify this in the master branch then it is safe to merge from master to your repository. Merge conflicts are unlikely.
We also plan a better way that does not need to fork the repository but it reuses the compiled maven artifacts. But this will take some time …