forked from spinscale/elasticsearch-ingest-opennlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (97 loc) · 3.25 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:6.1.3"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
}
}
plugins {
id "de.undercouch.download" version "3.2.0"
}
import de.undercouch.gradle.tasks.download.Download
group = 'de.spinscale.elasticsearch.plugin.ingest'
version = '6.1.3.1-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'io.codearte.nexus-staging'
// license of this project
licenseFile = rootProject.file('LICENSE.txt')
// copyright notices
noticeFile = rootProject.file('NOTICE.txt')
// disable uploadArchives task for now, no upload happening currently
uploadArchives.enabled = false
esplugin {
// license of the plugin, may be different than the above license
licenseFile rootProject.file('LICENSE.txt')
// copyright notices, may be different than the above notice
noticeFile rootProject.file('NOTICE.txt')
name 'ingest-opennlp'
description 'Ingest processor that uses OpenNLP for named entity extraction'
classname 'de.spinscale.elasticsearch.ingest.opennlp.IngestOpenNlpPlugin'
}
// In this section you declare the dependencies for your production and test code
// Elasticsearch dependency is included due to the build-tools, test-framework as well
dependencies {
compile 'org.apache.opennlp:opennlp-tools:1.8.4'
}
bundlePlugin {
from('src/test/resources/models') {
into 'config/'
}
}
integTestCluster {
setting 'ingest.opennlp.model.file.names', 'en-ner-persons.bin'
setting 'ingest.opennlp.model.file.locations', 'en-ner-locations.bin'
setting 'ingest.opennlp.model.file.dates', 'en-ner-dates.bin'
}
// check style can be disabled, or you can configure a different checkstyle file
// checkstyleMain.enabled = false
// checkstyleTest.enabled = false
// dependency license check needs can be enabled
dependencyLicenses.enabled = false
// thirdparty audit needs can be enabled
thirdPartyAudit.enabled = false
// license header checks can be disabled
licenseHeaders.enabled = true
// exlude the models for forbidden API check
forbiddenPatterns {
exclude '**/*.bin'
}
// download the models before the tests are run, also needed for packaging
project.afterEvaluate {
processTestResources.dependsOn downloadModels
}
// download the models but dont overwrite existing ones
task downloadModels {
doLast {
downloadIfNotExists('http://opennlp.sourceforge.net/models-1.5/en-ner-person.bin', 'en-ner-persons.bin')
downloadIfNotExists('http://opennlp.sourceforge.net/models-1.5/en-ner-location.bin', 'en-ner-locations.bin')
downloadIfNotExists('http://opennlp.sourceforge.net/models-1.5/en-ner-date.bin', 'en-ner-dates.bin')
}
}
def downloadIfNotExists(String url, String file) {
String dir = 'src' + File.separator + 'test' + File.separator + 'resources' + File.separator + 'models'
new File(dir).mkdirs()
if (new File(dir + File.separator + file).exists() == false) {
download {
src url
dest new File(dir, file)
}
}
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
nexusStaging {
packageGroup = "de.spinscale"
}