}
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()