This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
/
build.gradle
81 lines (72 loc) · 2.4 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
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'zhangcheng' at '17-1-17 下午8:18' with Gradle 2.10
*
* This generated file contains a commented-out sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.10/userguide/tutorial_java_projects.html
*/
group 'org.elasticsearch'
version = '1.0.0' // 适配不通版本的ES,可以修改这里。
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = "18" // 不同版本的es,需要不同版本的java环境,注意修改这里
targetCompatibility = "18" // 不同版本的es,需要不同版本的java环境,注意修改这里
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
jcenter()
mavenCentral()
}
sourceSets {
main {
java {
srcDir "src/main/java"
}
resources {
srcDir "src/main/resources"
srcDir "src/main/assemblies"
srcDir "src/main/dic"
include "**/*"
}
}
}
task initSourceFolders {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
configurations {
wagon
distJars {
extendsFrom runtimeOnly
exclude group: 'org.elasticsearch'
exclude group: 'lucene-core'
exclude group: 'org.apache.logging.log4j'
exclude group: 'lucene-analyzers-common'
exclude group: 'org.apache.commons'
}
}
dependencies {
implementation project(":jieba-analysis")
implementation 'org.elasticsearch:elasticsearch:8.4.1' // 适配不通版本的ES,可以修改这里。
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
testImplementation 'junit:junit:4.13.2'
}
tasks.named("processResources") {
duplicatesStrategy = 'include'
}
task pz(type: Zip, dependsOn: [':jar']) {
into("jieba") {
from configurations.distJars
from 'build/libs'
from 'jieba-analysis/build/libs'
from 'build/resources/main/plugin.xml'
from 'build/resources/main/plugin-descriptor.properties'
}
from('build/resources/main/') {
include '**.dict'
include '**.txt'
into('jieba/dic')
}
}