This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
145 lines (123 loc) · 4.21 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
buildscript {
ext {
es_group = "org.elasticsearch"
es_version = '7.10.2'
opendistroVersion = '1.13.0'
}
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath "${es_group}.gradle:build-tools:${es_version}"
}
}
plugins {
id 'java-library'
id 'maven-publish'
id "com.diffplug.gradle.spotless" version "3.26.1"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
group 'com.amazon.opendistroforelasticsearch.commons'
sourceCompatibility = 1.8
version = "${opendistroVersion}.0"
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compileOnly "org.elasticsearch.client:elasticsearch-rest-high-level-client:${es_version}"
testCompile "org.elasticsearch.test:framework:${es_version}"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
licenseHeaderFile 'spotless.license.java'
eclipse().configFile rootProject.file('.eclipseformat.xml')
}
}
shadowJar {
classifier = null
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
shadow(MavenPublication) {
project.shadow.component(it)
groupId = 'com.amazon.opendistroforelasticsearch'
artifactId = 'common-utils'
artifact sourcesJar
artifact javadocJar
pom {
name = "Open Distro for Elasticsearch Common Utils"
packaging = "jar"
url = "https://github.com/opendistro-for-elasticsearch/common-utils"
description = "Open Distro for Elasticsearch Common Utils"
scm {
connection = "scm:[email protected]:opendistro-for-elasticsearch/common-utils.git"
developerConnection = "scm:[email protected]:opendistro-for-elasticsearch/common-utils.git"
url = "[email protected]:opendistro-for-elasticsearch/common-utils.git"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "amazonwebservices"
organization = "Amazon Web Services"
organizationUrl = "https://aws.amazon.com"
}
}
}
}
}
repositories {
maven {
name = "sonatype-staging"
url "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
password project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
}
}
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
signing {
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
sign publishing.publications.shadow
}
}