-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
211 lines (179 loc) · 6.62 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License 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.
*/
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'distribution'
opensearchplugin {
name 'opensearch-querqy'
description 'Query rewriting plugin'
classname 'querqy.opensearch.QuerqyPlugin'
licenseFile rootProject.file('LICENSE.txt')
noticeFile rootProject.file('NOTICE.txt')
}
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "2.7.0")
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
}
}
ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}
repositories {
mavenLocal()
}
allprojects {
group = "org.opensearch"
version = "1.0.os2.7.0"
if (isSnapshot) {
version += "-SNAPSHOT"
}
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "11"
}
tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
dependencies {
api('org.querqy:querqy-lucene:5.4.lucene900.1')
api('com.fasterxml.jackson.core:jackson-databind')
api('com.fasterxml.jackson.core:jackson-core:2.14.2')
api('com.fasterxml.jackson.core:jackson-annotations:2.14.2')
api('com.jayway.jsonpath:json-path:2.7.0')
implementation("commons-io:commons-io:2.11.0")
implementation("org.querqy:querqy-core:3.14.1")
implementation("net.minidev:json-smart:2.4.8")
implementation("net.minidev:accessors-smart:2.4.8")
implementation("org.ow2.asm:asm:9.3")
implementation("org.slf4j:slf4j-api:2.0.1")
testImplementation('junit:junit:4.13.2')
testImplementation('org.mockito:mockito-core:5.2.0')
testImplementation('org.apache.logging.log4j:log4j-core:2.17.1')
testImplementation('org.assertj:assertj-core:3.23.1')
}
test {
useJUnit()
finalizedBy jacocoTestReport
include "**/*Test.class"
systemProperties 'java.security.policy': file("$projectDir/plugin-security.policy").absolutePath
}
jacoco {
toolVersion = "0.8.5"
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
configurations.all {
resolutionStrategy.force 'junit:junit:4.13.2'
resolutionStrategy.force'com.fasterxml.jackson.core:jackson-databind:2.13.3'
}
licenseHeaders.enabled = true
// no need to validate pom, as we do not upload to maven/sonatype
validateNebulaPom.enabled = false
generatePomFileForNebulaPublication.enabled = false
generateMetadataFileForNebulaPublication.enabled = false
publishNebulaPublicationToMavenLocal.enabled = false
// TODO: find better way to exclude publishNebulaPublicationToSonatypeRepository
tasks.whenTaskAdded {task ->
if(task.name.contains("publishNebulaPublicationToSonatypeRepository")) {
task.enabled = false
}
}
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
// Allow @Test to be used in test classes not inherited from LuceneTestCase.
// see https://github.com/elastic/elasticsearch/blob/26c3dd6857d047054b2108f85bc2b040a9c81fe4/build-tools-internal/src/main/resources/forbidden/es-test-signatures.txt
forbiddenApis.ignoreFailures = true
// Allow test cases to be named Tests without having to be inherited from LuceneTestCase.
// see https://github.com/elastic/elasticsearch/blob/323f312bbc829a63056a79ebe45adced5099f6e6/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java
testingConventions.enabled = false
loggerUsageCheck.enabled = false
publishing {
publications {
mavenJava(MavenPublication) {
artifact distZip
groupId = 'org.querqy'
artifactId = 'opensearch-querqy'
version = "$version"
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Querqy Opensearch'
description = 'This is the Opensearch plugin version of Querqy - a query preprocessing framework for Java-based search engines.'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'jope'
name = 'Johannes Peter'
email = '[email protected]'
url = 'https://github.com/querqy/querqy-opensearch'
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
name = 'sonatype'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials(PasswordCredentials)
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}