Java 类org.gradle.api.artifacts.maven.MavenPom 实例源码

项目:Reer    文件:MavenPlugin.java   
private void configureUploadArchivesTask() {
    configurationActionContainer.add(new Action<Project>() {
        public void execute(Project project) {
            Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME);
            if (uploadArchives == null) {
                return;
            }

            ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
            Module module = configuration.getModule();
            for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
                MavenPom pom = resolver.getPom();
                ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
                        pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(),
                        pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
                        pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
                );
                publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
            }
        }
    });
}
项目:Pushjet-Android    文件:MavenPlugin.java   
private void configureUploadArchivesTask() {
    configurationActionContainer.add(new Action<Project>() {
        public void execute(Project project) {
            Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME);
            if (uploadArchives == null) { return; }

            ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
            ModuleInternal module = configuration.getModule();
            for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
                MavenPom pom = resolver.getPom();
                ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
                        pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(),
                        pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
                        pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
                );
                publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
            }
        }
    });
}
项目:Pushjet-Android    文件:MavenPlugin.java   
private void configureUploadArchivesTask() {
    configurationActionContainer.add(new Action<Project>() {
        public void execute(Project project) {
            Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME);
            if (uploadArchives == null) { return; }

            ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration();
            ModuleInternal module = configuration.getModule();
            for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) {
                MavenPom pom = resolver.getPom();
                ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(
                        pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(),
                        pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(),
                        pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion()
                );
                publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId));
            }
        }
    });
}
项目:Reer    文件:DefaultArtifactPom.java   
private void assignArtifactValuesToPom(Artifact artifact, MavenPom pom, boolean setType) {
    if (pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID)) {
        pom.setGroupId(artifact.getModuleRevisionId().getOrganisation());
    }
    if (pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) {
        pom.setArtifactId(artifact.getName());
    }
    if (pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION)) {
        pom.setVersion(artifact.getModuleRevisionId().getRevision());
    }
    if (setType) {
        pom.setPackaging(artifact.getType());
    }
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom addFilter(String name, PublishFilter publishFilter) {
    if (name == null || publishFilter == null) {
        throw new InvalidUserDataException("Name and Filter must not be null.");
    }
    MavenPom pom = mavenPomFactory.create();
    pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
    return pom;
}
项目:Pushjet-Android    文件:DefaultArtifactPom.java   
private void assignArtifactValuesToPom(Artifact artifact, MavenPom pom, boolean setType) {
    if (pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID)) {
        pom.setGroupId(artifact.getModuleRevisionId().getOrganisation());
    }
    if (pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) {
        pom.setArtifactId(artifact.getName());
    }
    if (pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION)) {
        pom.setVersion(artifact.getModuleRevisionId().getRevision());
    }
    if (setType) {
        pom.setPackaging(artifact.getType());
    }
}
项目:Pushjet-Android    文件:BasePomFilterContainer.java   
public MavenPom addFilter(String name, PublishFilter publishFilter) {
    if (name == null || publishFilter == null) {
        throw new InvalidUserDataException("Name and Filter must not be null.");
    }
    MavenPom pom = mavenPomFactory.create();
    pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
    return pom;
}
项目:Pushjet-Android    文件:DefaultArtifactPom.java   
private void assignArtifactValuesToPom(Artifact artifact, MavenPom pom, boolean setType) {
    if (pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID)) {
        pom.setGroupId(artifact.getModuleRevisionId().getOrganisation());
    }
    if (pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID)) {
        pom.setArtifactId(artifact.getName());
    }
    if (pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION)) {
        pom.setVersion(artifact.getModuleRevisionId().getRevision());
    }
    if (setType) {
        pom.setPackaging(artifact.getType());
    }
}
项目:Pushjet-Android    文件:BasePomFilterContainer.java   
public MavenPom addFilter(String name, PublishFilter publishFilter) {
    if (name == null || publishFilter == null) {
        throw new InvalidUserDataException("Name and Filter must not be null.");
    }
    MavenPom pom = mavenPomFactory.create();
    pomFilters.put(name, new DefaultPomFilter(name, pom, publishFilter));
    return pom;
}
项目:Reer    文件:DefaultPomFilter.java   
public DefaultPomFilter(String name, MavenPom pom, PublishFilter filter) {
    this.name = name;
    this.pom = pom;
    this.filter = filter;
}
项目:Reer    文件:DefaultPomFilter.java   
public MavenPom getPomTemplate() {
    return pom;
}
项目:Reer    文件:DefaultPomFilter.java   
public void setPomTemplate(MavenPom pom) {
    this.pom = pom;
}
项目:Reer    文件:DefaultMavenPomFactory.java   
public MavenPom create() {
    return new DefaultMavenPom(configurationContainer,
            new DefaultConf2ScopeMappingContainer(conf2ScopeMappingContainer.getMappings()), pomDependenciesConverter, fileResolver);
}
项目:Reer    文件:DefaultMavenFactory.java   
public Factory<MavenPom> createMavenPomFactory(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer conf2ScopeMappingContainer, FileResolver fileResolver) {
    return new DefaultMavenPomFactory(configurationContainer, conf2ScopeMappingContainer, createPomDependenciesConverter(), fileResolver);
}
项目:Reer    文件:DefaultMavenFactory.java   
public Factory<MavenPom> createMavenPomFactory(ConfigurationContainer configurationContainer, Map<Configuration, Conf2ScopeMapping> mappings, FileResolver fileResolver) {
    return new DefaultMavenPomFactory(configurationContainer, createConf2ScopeMappingContainer(mappings), createPomDependenciesConverter(), fileResolver);
}
项目:Reer    文件:DefaultMavenPom.java   
public DefaultMavenPom whenConfigured(final Action<MavenPom> action) {
    whenConfiguredActions.add(action);
    return this;
}
项目:Reer    文件:DefaultDeployerFactory.java   
private PomFilterContainer createPomFilterContainer(Factory<MavenPom> mavenPomFactory) {
    return new BasePomFilterContainer(mavenPomFactory);
}
项目:Reer    文件:DefaultArtifactPom.java   
public DefaultArtifactPom(MavenPom pom) {
    this.pom = pom;
}
项目:Reer    文件:DefaultArtifactPom.java   
public MavenPom getPom() {
    return pom;
}
项目:Reer    文件:DefaultArtifactPomFactory.java   
public ArtifactPom createArtifactPom(MavenPom pom) {
    return new DefaultArtifactPom(pom);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom getPom() {
    return pomFilterContainer.getPom();
}
项目:Reer    文件:AbstractMavenResolver.java   
public void setPom(MavenPom defaultPom) {
    pomFilterContainer.setPom(defaultPom);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom addFilter(String name, PublishFilter publishFilter) {
    return pomFilterContainer.addFilter(name, publishFilter);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom addFilter(String name, Closure filter) {
    return pomFilterContainer.addFilter(name, filter);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom pom(String name) {
    return pomFilterContainer.pom(name);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom pom(Closure configureClosure) {
    return pomFilterContainer.pom(configureClosure);
}
项目:Reer    文件:AbstractMavenResolver.java   
public MavenPom pom(String name, Closure configureClosure) {
    return pomFilterContainer.pom(name, configureClosure);
}
项目:Reer    文件:BasePomFilterContainer.java   
public BasePomFilterContainer(Factory<MavenPom> mavenPomFactory) {
    this.mavenPomFactory = mavenPomFactory;
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom getPom() {
    return getDefaultPomFilter().getPomTemplate();
}
项目:Reer    文件:BasePomFilterContainer.java   
public void setPom(MavenPom defaultPom) {
    getDefaultPomFilter().setPomTemplate(defaultPom);
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom addFilter(String name, Closure filter) {
    return addFilter(name, toFilter(filter));
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom pom(Closure configureClosure) {
    return ConfigureUtil.configure(configureClosure, getPom());
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom pom(String name, Closure configureClosure) {
    return ConfigureUtil.configure(configureClosure, pom(name));
}
项目:Reer    文件:BasePomFilterContainer.java   
public MavenPom pom(String name) {
    if (name == null) {
        throw new InvalidUserDataException("Name must not be null.");
    }
    return pomFilters.get(name).getPomTemplate();
}
项目:Reer    文件:BasePomFilterContainer.java   
public Factory<MavenPom> getMavenPomFactory() {
    return mavenPomFactory;
}
项目:Pushjet-Android    文件:DefaultPomFilter.java   
public DefaultPomFilter(String name, MavenPom pom, PublishFilter filter) {
    this.name = name;
    this.pom = pom;
    this.filter = filter;
}
项目:Pushjet-Android    文件:DefaultPomFilter.java   
public MavenPom getPomTemplate() {
    return pom;
}
项目:Pushjet-Android    文件:DefaultPomFilter.java   
public void setPomTemplate(MavenPom pom) {
    this.pom = pom;
}
项目:Pushjet-Android    文件:DefaultMavenPomFactory.java   
public MavenPom create() {
    return new DefaultMavenPom(configurationContainer,
            new DefaultConf2ScopeMappingContainer(conf2ScopeMappingContainer.getMappings()), pomDependenciesConverter, fileResolver);
}
项目:Pushjet-Android    文件:DefaultDeployerFactory.java   
private PomFilterContainer createPomFilterContainer(Factory<MavenPom> mavenPomFactory) {
    return new BasePomFilterContainer(mavenPomFactory);
}