@Override public void execute(MavenPublication mavenPublication) { mavenPublication.getPom().withXml(extension); }
/** * Customizes the pom. The method requires following properties on root project to function correctly: */ public static void customizePom(final Project project, final ShipkitConfiguration conf, final MavenPublication publication) { publication.getPom().withXml(new Action<XmlProvider>() { public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new ProjectContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } }); }
/** * Customizes the pom. The method requires following properties on root project to function correctly: */ public static void customizePom(final Project project, final ShipkitConfiguration conf, final MavenPublication publication) { publication.getPom().withXml(new Action<XmlProvider>() { public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new ProjectContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } }); }
/** * Customizes the pom. The method requires following properties on root project to function correctly: */ public static void customizePom(final Project project, final ReleaseConfiguration conf, final MavenPublication publication) { publication.getPom().withXml(new Action<XmlProvider>() { public void execute(XmlProvider xml) { String archivesBaseName = (String) project.getProperties().get("archivesBaseName"); File contributorsFile = contributorsFile(project); LOG.info(" Read project contributors from file: " + contributorsFile.getAbsolutePath()); // It can happens that contributorsFile doesn't exist e.g. when shipkit.team.contributors is NOT empty ProjectContributorsSet contributorsFromGitHub = new AllContributorsSerializer() .deserialize(IOUtil.readFullyOrDefault(contributorsFile, "[]")); LOG.info(" Customizing pom for publication " + publication.getName() + " in " + project.toString() + "\n - Module name (project.archivesBaseName): " + archivesBaseName + "\n - Description (project.description): " + project.getDescription() + "\n - GitHub repository (project.rootProject.shipkit.gitHub.repository): " + conf.getGitHub().getRepository() + "\n - Developers (project.rootProject.shipkit.team.developers): " + StringUtil.join(conf.getTeam().getDevelopers(), ", ") + "\n - Contributors (project.rootProject.shipkit.team.contributors): " + StringUtil.join(conf.getTeam().getContributors(), ", ") + "\n - Contributors read from GitHub: " + StringUtil.join(contributorsFromGitHub.toConfigNotation(), ", ")); customizePom(xml.asNode(), conf, archivesBaseName, project.getDescription(), contributorsFromGitHub); } }); }
MavenPom pom = pub.getPom(); pom.developers( devs -> { devs.developer( dev -> {
MavenPom pom = pub.getPom(); pom.developers( devs -> { devs.developer( dev -> {
} ); pubs.create( "mavenJava", MavenPublication.class, pub -> { MavenPom pom = pub.getPom(); pom.developers( devs -> { devs.developer( dev -> {