代码拉取完成,页面将自动刷新
apply plugin: "maven"
apply plugin: "propdeps-maven"
def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test' || dep.artifactId == 'elasticsearch-hadoop-mr'
}
// for es-hadoop optional is best served as provided/optional vs compile/optional
generatedPom.dependencies.findAll { it.optional == true }.each {
it.scope = "provided"
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'http://github.com/elasticsearch/elasticsearch-hadoop'
organization {
name = 'Elasticsearch'
url = 'http://www.elasticsearch.org/'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'http://github.com/elasticsearch/elasticsearch-hadoop'
connection = 'scm:git:git://github.com/elasticsearch/elasticsearch-hadoop'
developerConnection = 'scm:git:git://github.com/elasticsearch/elasticsearch-hadoop'
}
developers {
developer {
id = 'costin'
name = 'Costin Leau'
email = 'costin@elasticsearch.com'
properties {
twitter = 'costinl'
}
}
}
}
groupId = "org.elasticsearch"
artifactId = project.archivesBaseName
}
}
ext.deployUsername = { project.hasProperty("repoUsername") ? getProperty("repoUsername") : "" }
ext.deployPassword = { project.hasProperty("repoPassword") ? getProperty("repoPassword") : "" }
repositories {
flatDir {
name "fileRepo"
dirs "repo"
}
}
uploadArchives {
repositories {
//add project.repositories.fileRepo
mavenDeployer {
customizePom(pom, project)
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: deployUsername(), password: deployPassword())
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: deployUsername(), password: deployPassword())
}
}
}
}
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
//
// S3
//
// task to upload artifacts belonging to S3 configuration object
// need to share it across scripts so the method is defined as a task instead of a def
// lazy depends could work but we avoid it since not all projects use distZip
task uploadToS3() {
group = "Distribution"
description = "Upload ZIPs to S3"
logging.level = LogLevel.INFO
// execution phase only
doLast() {
// distZip might not create an s3 config so check its existence first
if (configurations.find({ it.name == 's3' })) {
uploadArtifactsToS3(project, toDir)
}
}
}
def uploadArtifactsToS3(target, toDir) {
configurations { antlibs }
dependencies {
antlibs "org.springframework.build:org.springframework.build.aws.ant:3.0.6.RELEASE"
antlibs "net.java.dev.jets3t:jets3t:0.8.1"
}
// see ant logging
target.logging.level = LogLevel.INFO
ant {
taskdef(resource: 'org/springframework/build/aws/ant/antlib.xml', classpath: configurations.antlibs.asPath)
s3(accessKey: s3AccessKey, secretKey: s3SecretAccessKey) {
target.configurations["s3"].artifacts.each { artifact ->
def archive = artifact.archiveTask
upload(bucketName: 'download.elasticsearch.org', file: archive.archivePath,
toFile: toDir + "/${archive.archiveName}",
publicRead: 'false') {
metadata(name: 'project.name', value: project)
metadata(name: 'package.file.name', value: archive.archiveName)
}
// checksum
def checksum = file(archive.archivePath.absolutePath + ".sha1.txt")
if (checksum.exists()) {
upload(bucketName: 'download.elasticsearch.org', file: archive.archivePath.absolutePath + ".sha1.txt",
toFile: toDir + "/${archive.archiveName}" + ".sha1.txt",
publicRead: 'false')
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。