@@ -68,6 +68,22 @@ tasks.withType<Jar> {
68
68
}
69
69
}
70
70
71
+ tasks.withType<Javadoc > {
72
+ val opt = options as StandardJavadocDocletOptions
73
+ // Gradle calls javadoc with a list of file and not a path. This prevents doc-files from being copied.
74
+ opt.addStringOption(" sourcepath" , project.projectDir.path + " /src/main/java" )
75
+ opt.docFilesSubDirs(true )
76
+
77
+ doLast {
78
+ // Javadoc adds its decoration to html doc files, including quite some JS. This slows down the api spec
79
+ // redirector that doesn't need it. So overwrite the target file with the original one.
80
+ val specFile = " co/elastic/clients/elasticsearch/doc-files/api-spec.html"
81
+ val source = File (project.projectDir, " src/main/java/" + specFile)
82
+ val target = File (project.projectDir, " build/docs/javadoc/" + specFile)
83
+ source.copyTo(target, overwrite = true )
84
+ }
85
+ }
86
+
71
87
publishing {
72
88
repositories {
73
89
maven {
@@ -87,9 +103,9 @@ publishing {
87
103
create<MavenPublication >(" maven" ) {
88
104
from(components[" java" ])
89
105
pom {
90
- name.set(" Elasticsearch Java Client" )
106
+ name.set(" Elasticsearch Java API Client" )
91
107
artifactId = " elasticsearch-java"
92
- description.set(" Next-gen Elasticsearch Java Client" )
108
+ description.set(" Elasticsearch Java API Client" )
93
109
url.set(" https://github.com/elastic/elasticsearch-java/" )
94
110
licenses {
95
111
license {
@@ -109,14 +125,41 @@ publishing {
109
125
developerConnection.set(" scm:git:ssh://git@github.com:elastic/elasticsearch-java.git" )
110
126
url.set(" https://github.com/elastic/elasticsearch-java/" )
111
127
}
128
+
129
+ withXml {
130
+ // Set the version of dependencies of the org.elasticsearch.client group to the one that we are building.
131
+ // Since the unified release process releases everything at once, this ensures all published artifacts depend
132
+ // on the exact same version. This assumes of course that the binary API and the behavior of these dependencies
133
+ // are the same as the one used in the dependency section below.
134
+ val xPathFactory = javax.xml.xpath.XPathFactory .newInstance()
135
+ val depSelector = xPathFactory.newXPath()
136
+ .compile(" /project/dependencies/dependency[groupId/text() = 'org.elasticsearch.client']" )
137
+ val versionSelector = xPathFactory.newXPath().compile(" version" )
138
+
139
+ var foundVersion = false ;
140
+
141
+ val deps = depSelector.evaluate(asElement().ownerDocument, javax.xml.xpath.XPathConstants .NODESET )
142
+ as org.w3c.dom.NodeList
143
+
144
+ for (i in 0 until deps.length) {
145
+ val dep = deps.item(i)
146
+ val version = versionSelector.evaluate(dep, javax.xml.xpath.XPathConstants .NODE ) as org.w3c.dom.Element
147
+ foundVersion = true ;
148
+ version.textContent = project.version.toString()
149
+ }
150
+
151
+ if (! foundVersion) {
152
+ throw GradleException (" Could not find a 'org.elasticsearch.client' to update dependency version in the POM." )
153
+ }
154
+ }
112
155
}
113
156
}
114
157
}
115
158
}
116
159
117
160
dependencies {
118
- val elasticsearchVersion = " 7.15.0 "
119
- val jacksonVersion = " 2.12.0 "
161
+ val elasticsearchVersion = " 7.17.0-SNAPSHOT "
162
+ val jacksonVersion = " 2.13.1 "
120
163
121
164
// Apache 2.0
122
165
// https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html
@@ -153,7 +196,7 @@ dependencies {
153
196
154
197
// EPL-1.0
155
198
// https://junit.org/junit4/
156
- testImplementation(" junit" , " junit" , " 4.12 " )
199
+ testImplementation(" junit" , " junit" , " 4.13.2 " )
157
200
158
201
// MIT
159
202
// https://github.com/classgraph/classgraph
0 commit comments