refactor common functionality for the Gradle and Maven plugins into a base plugin runtime