2
2
* Copyright OpenSearch Contributors
3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*/
5
- import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
6
5
7
6
8
7
buildscript {
@@ -22,7 +21,7 @@ plugins {
22
21
id ' signing'
23
22
}
24
23
25
- group ' org.opensearch.driver '
24
+ group ' org.opensearch.client '
26
25
27
26
// keep version in sync with version in Driver source
28
27
version ' 2.0.0.0'
@@ -47,49 +46,29 @@ repositories {
47
46
48
47
dependencies {
49
48
implementation group : ' org.apache.httpcomponents' , name : ' httpclient' , version : ' 4.5.13'
50
- implementation group : ' com.fasterxml.jackson.core' , name : ' jackson-databind' , version : " 2.13.3 "
49
+ implementation group : ' com.fasterxml.jackson.core' , name : ' jackson-databind' , version : " 2.13.4.2 "
51
50
implementation group : ' com.amazonaws' , name : ' aws-java-sdk-core' , version : ' 1.11.452'
52
51
53
52
testImplementation(' org.junit.jupiter:junit-jupiter-api:5.3.1' )
54
53
testImplementation(' org.junit.jupiter:junit-jupiter-params:5.3.1' )
55
- testImplementation(' com.github.tomakehurst:wiremock:2.27.2 ' )
54
+ testImplementation(' com.github.tomakehurst:wiremock-jre8-standalone :2.34.0 ' )
56
55
testImplementation(' org.mockito:mockito-core:2.23.0' )
57
56
testImplementation(' org.junit.jupiter:junit-jupiter-engine:5.3.1' )
58
57
testImplementation(' org.junit-pioneer:junit-pioneer:0.3.0' )
59
- testImplementation(' org.eclipse.jetty:jetty-server:9.2.24.v20180105 ' )
58
+ testImplementation(' org.eclipse.jetty:jetty-server:9.4.48.v20220622 ' )
60
59
61
- // Enforce wiremock to use latest guava and json-smart
60
+ // Enforce wiremock to use latest guava
62
61
testImplementation(' com.google.guava:guava:31.1-jre' )
63
- testImplementation(' net.minidev:json-smart:2.4.8' )
64
62
65
63
testRuntimeOnly(' org.slf4j:slf4j-simple:1.7.25' ) // capture WireMock logging
66
-
67
- // JDBC drivers for comparison test. Somehow Apache Derby throws security permission exception.
68
- testImplementation fileTree(' /build/libs' ) {
69
- include ' *.jar'
70
- builtBy ' compileJdbc'
71
- }
72
- testImplementation group : ' com.h2database' , name : ' h2' , version : ' 2.1.210'
73
- testImplementation group : ' org.xerial' , name : ' sqlite-jdbc' , version : ' 3.28.0'
74
- testImplementation group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.9'
75
- }
76
-
77
- task compileJdbc (type : Exec ) {
78
- if (DefaultNativePlatform . getCurrentOperatingSystem(). isWindows()) {
79
- commandLine ' ./gradlew.bat' , ' build'
80
- commandLine ' ./gradlew.bat' , ' shadowJar'
81
- } else {
82
- commandLine ' ./gradlew' , ' build'
83
- commandLine ' ./gradlew' , ' shadowJar'
84
- }
85
64
}
86
65
87
66
tasks. withType(JavaCompile ) {
88
67
options. compilerArgs << " -Xlint:deprecation" << " -Xlint:unchecked"
89
68
}
90
69
91
70
static def getShadowPath (String path ) {
92
- return ' org .opensearch.sql.jdbc.shadow.' + path
71
+ return ' com.amazonaws .opensearch.sql.jdbc.shadow.' + path
93
72
}
94
73
95
74
shadowJar {
@@ -107,14 +86,18 @@ shadowJar {
107
86
exclude ' META-INF/NOTICE*'
108
87
exclude ' META-INF/DEPENDENCIES'
109
88
110
- relocate ' com.amazonaws' , getShadowPath(' com.amazonaws' )
89
+ relocate(' com.amazonaws' , getShadowPath(' com.amazonaws' )) {
90
+ exclude ' com.amazonaws.opensearch.*/**'
91
+ }
92
+
111
93
relocate ' org.apache' , getShadowPath(' org.apache' )
112
94
relocate ' org.joda' , getShadowPath(' org.joda' )
113
95
relocate ' com.fasterxml' , getShadowPath(' com.fasterxml' )
114
96
relocate ' software.amazon' , getShadowPath(' software.amazon' )
115
97
}
116
98
117
99
test {
100
+ systemProperty(" opensearch_jdbc_version" , version);
118
101
useJUnitPlatform()
119
102
}
120
103
@@ -136,59 +119,47 @@ publishing {
136
119
artifact javadocJar
137
120
138
121
pom {
139
- name = " OpenSearch SQL JDBC Driver"
140
- packaging = " jar"
141
- url = " https://github.com/opensearch-project/sql/sql-jdbc"
142
- description = " OpenSearch SQL JDBC driver"
143
- scm {
144
- connection
= " scm:[email protected] :opensearch-project/sql.git"
145
- developerConnection
= " scm:[email protected] :opensearch-project/sql.git"
146
- url
= " [email protected] :opensearch-project/sql.git"
147
- }
148
- licenses {
149
- license {
150
- name = " The Apache License, Version 2.0"
151
- url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
152
- }
122
+ name = " OpenSearch SQL JDBC Driver"
123
+ packaging = " jar"
124
+ url = " https://github.com/opensearch-project/sql"
125
+ description = " OpenSearch SQL JDBC driver"
126
+ scm {
127
+ connection
= " scm:[email protected] :opensearch-project/sql.git"
128
+ developerConnection
= " scm:[email protected] :opensearch-project/sql.git"
129
+ url
= " [email protected] :opensearch-project/sql.git"
130
+ }
131
+ licenses {
132
+ license {
133
+ name = " The Apache License, Version 2.0"
134
+ url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
153
135
}
154
- developers {
155
- developer {
156
- name = ' OpenSearch'
157
- url = ' https://github.com/opensearch-project/sql'
158
- }
159
- }
160
- }
161
- }
162
- publishMaven(MavenPublication ) { publication ->
163
- from components. java
164
-
165
- pom {
166
- name = " OpenSearch SQL JDBC Driver"
167
- packaging = " jar"
168
- url = " https://github.com/opensearch-project/sql/sql-jdbc"
169
- description = " OpenSearch SQL JDBC driver"
170
- scm {
171
- connection
= " scm:[email protected] :opensearch-project/sql.git"
172
- developerConnection
= " scm:[email protected] :opensearch-project/sql.git"
173
- url
= " [email protected] :opensearch-project/sql.git"
174
- }
175
- licenses {
176
- license {
177
- name = " The Apache License, Version 2.0"
178
- url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
179
- }
180
- }
181
- developers {
182
- developer {
183
- name = ' OpenSearch'
184
- url = ' https://github.com/opensearch-project/sql'
185
- }
136
+ }
137
+ developers {
138
+ developer {
139
+ id = " amazonwebservices"
140
+ organization = " Amazon Web Services"
141
+ organizationUrl = " https://aws.amazon.com"
186
142
}
143
+ }
187
144
}
188
145
}
189
146
}
190
147
191
148
repositories {
149
+ maven {
150
+ name = " internal-snapshots"
151
+ url = " s3://snapshots.opendistroforelasticsearch.amazon.com/maven"
152
+ authentication {
153
+ awsIm(AwsImAuthentication ) // load from EC2 role or env var
154
+ }
155
+ }
156
+ maven {
157
+ name = " internal-releases"
158
+ url = " s3://artifacts.opendistroforelasticsearch.amazon.com/maven"
159
+ authentication {
160
+ awsIm(AwsImAuthentication ) // load from EC2 role or env var
161
+ }
162
+ }
192
163
maven {
193
164
name = " sonatype-staging"
194
165
url " https://aws.oss.sonatype.org/service/local/staging/deploy/maven2"
@@ -197,10 +168,6 @@ publishing {
197
168
password project. hasProperty(' ossrhPassword' ) ? project. property(' ossrhPassword' ) : ' '
198
169
}
199
170
}
200
- maven {
201
- name = " localRepo"
202
- url " ${ project.buildDir} /repository"
203
- }
204
171
}
205
172
206
173
// TODO - enabled debug logging for the time being, remove this eventually
@@ -234,6 +201,4 @@ jacocoTestCoverageVerification {
234
201
}
235
202
}
236
203
237
-
238
-
239
204
check. dependsOn jacocoTestCoverageVerification
0 commit comments