Java 类org.gradle.api.publish.maven.internal.publication.MavenPomInternal 实例源码

项目:gradle-defaults    文件:MavenPublishPublications.java   
private static void groupid(Project project, MavenPomInternal pom) {
    val projectIdentity = pom.getProjectIdentity();
    if (!isNotEmpty(projectIdentity.getGroupId())) {
        if (!isNotEmpty(project.getGroup().toString())) {
            val topPackageName = ProjectUtilsKt.detectTopPackageName(project.getConvention());
            if (topPackageName == null) {
                throw new IllegalStateException("There is no group set on the project, and could not auto-detect one");
            }
            LOG.warn("Auto-detecting the group id as \"" + topPackageName +
                "\", but should be explicitly set on the project.\nIn build.gradle, add:\n   group = \"" +
                topPackageName + "\"");
            project.setGroup(topPackageName);
        }
        projectIdentity.setGroupId(project.getGroup().toString());
    }
}
项目:Reer    文件:GenerateMavenPom.java   
@TaskAction
public void doGenerate() {
    MavenPomInternal pomInternal = (MavenPomInternal) getPom();

    MavenPomFileGenerator pomGenerator = new MavenPomFileGenerator(pomInternal.getProjectIdentity(), getVersionRangeMapper());
    pomGenerator.setPackaging(pomInternal.getPackaging());

    for (MavenDependencyInternal runtimeDependency : pomInternal.getRuntimeDependencies()) {
        pomGenerator.addRuntimeDependency(runtimeDependency);
    }

    pomGenerator.withXml(pomInternal.getXmlAction());

    pomGenerator.writeTo(getDestination());
}
项目:Pushjet-Android    文件:GenerateMavenPom.java   
@TaskAction
public void doGenerate() {
    MavenPomInternal pomInternal = (MavenPomInternal) getPom();

    MavenPomFileGenerator pomGenerator = new MavenPomFileGenerator(pomInternal.getProjectIdentity());
    pomGenerator.setPackaging(pomInternal.getPackaging());

    for (MavenDependencyInternal runtimeDependency : pomInternal.getRuntimeDependencies()) {
        pomGenerator.addRuntimeDependency(runtimeDependency);
    }

    pomGenerator.withXml(pomInternal.getXmlAction());

    pomGenerator.writeTo(getDestination());
}
项目:Pushjet-Android    文件:GenerateMavenPom.java   
@TaskAction
public void doGenerate() {
    MavenPomInternal pomInternal = (MavenPomInternal) getPom();

    MavenPomFileGenerator pomGenerator = new MavenPomFileGenerator(pomInternal.getProjectIdentity());
    pomGenerator.setPackaging(pomInternal.getPackaging());

    for (MavenDependencyInternal runtimeDependency : pomInternal.getRuntimeDependencies()) {
        pomGenerator.addRuntimeDependency(runtimeDependency);
    }

    pomGenerator.withXml(pomInternal.getXmlAction());

    pomGenerator.writeTo(getDestination());
}
项目:gradle-defaults    文件:MavenPublishPublications.java   
private static MavenPublication createMainPublication(Project project) {
    val publishing = project.getConvention().getByType(PublishingExtension.class);
    val pub = publishing.getPublications().create(PUBLICATION_NAME, MavenPublication.class);

    publishing.getRepositories().mavenLocal();

    project.afterEvaluate(prj -> groupid(project, (MavenPomInternal)pub.getPom()));

    configPom(project, pub);

    return pub;
}