GithubPomPlugin implements Plugin<Project> { @Override public void apply(Project project) { this.project = project; githubBasePlugin = project.getRootProject().getPlugins().apply(GithubBasePlugin.class); githubExtension = githubBasePlugin.getGithubExtension(); githubService = githubBasePlugin.getGithubClient().getGithubService(); project.afterEvaluate(p -> { slug = githubExtension.getSlug().get(); try { repo = githubService.getRepository(slug).execute().body(); user = githubService.getUser(githubExtension.getOwner().get()).execute().body(); if (repo.getLicense() != null) { ghLicense = githubService.getLicense(repo.getLicense().getUrl()).execute().body(); } } catch (IOException e) { throw new RuntimeException(e); } project.getPlugins().withType(PublishingPlugin.class, publishingPlugin -> { project.getExtensions().getByType(PublishingExtension.class).getPublications() .withType(MavenPublication.class, this::configureMavenPublication); }); }); }  @Override void apply(Project project);  }
@Test void apply() { project.getPlugins().apply(GithubPomPlugin.class); project.getPlugins().apply(MavenPublishJavaPlugin.class); }