-
Notifications
You must be signed in to change notification settings - Fork 865
/
pom.xml
366 lines (362 loc) · 15 KB
/
pom.xml
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0</version>
</parent>
<artifactId>java-driver-core-shaded</artifactId>
<name>Apache Cassandra Java Driver - core with shaded deps</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>java-driver-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--
Declare a dependency to the core driver itself so that all its classes get included;
this dependency will be removed from the final pom by the shade plugin.
-->
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core</artifactId>
</dependency>
<!--
Repeat all dependencies of the core driver *except* the ones that are going to be shaded,
so that they get included in the final pom (we don't use the "promoteTransitiveDependencies"
option of the shade plugin because it promotes all dependencies, even nested ones, to top level).
-->
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>native-protocol</artifactId>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-shaded-guava</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.lz4</groupId>
<artifactId>lz4-java</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
</dependency>
<dependency>
<groupId>com.esri.geometry</groupId>
<artifactId>esri-geometry-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</dependency>
<dependency>
<groupId>com.github.stephenc.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<!--
Generation of the shaded driver-core bundle during package phase:
1) shade plugin shades the driver and creates a shaded jar + source jar
2) dependency plugin unpacks the shaded jar to target/classes (and removes unwanted content)
3) bundle plugin analyzes shaded classes and generates the bundle manifest
4) assembly plugin re-creates the shaded jar by packing target/classes + manifest + shaded pom
-->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${project.basedir}/..</directory>
<includes>
<include>LICENSE</include>
<include>NOTICE_binary.txt</include>
<include>NOTICE.txt</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-core-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet>
<includes>
<!--
Include:
- The core driver itself; it is not relocated but needs to be included.
- All the dependencies we want to shade & relocate.
-->
<include>org.apache.cassandra:java-driver-core</include>
<include>io.netty:*</include>
<include>com.fasterxml.jackson.core:*</include>
</includes>
</artifactSet>
<relocations>
<!--
Check if relocations declared here must also be declared below to operate on
GraalVM's reflection.json file. Currently this is required for Netty only.
-->
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.datastax.oss.driver.shaded.netty</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>com.datastax.oss.driver.shaded.fasterxml.jackson</shadedPattern>
</relocation>
</relocations>
<filters>
<!-- Exclude everything under META-INF -->
<filter>
<artifact>org.apache.cassandra:*</artifact>
<excludes>
<!-- Don't exclude META-INF/services and META-INF/native-image -->
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/maven/**</exclude>
</excludes>
</filter>
<filter>
<artifact>io.netty:*</artifact>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
<filter>
<artifact>com.fasterxml.jackson.core:*</artifact>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-shaded-classes</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core-shaded</artifactId>
<type>jar</type>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<!-- Unpack shaded sources in order to run javadoc on them: -->
<execution>
<id>unpack-shaded-sources</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.cassandra</groupId>
<artifactId>java-driver-core-shaded</artifactId>
<type>jar</type>
<classifier>sources</classifier>
<outputDirectory>${project.build.directory}/shaded-sources</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Apply shading to classes declared in GraalVM reflection.json config file -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<id>shade-graalvm-files</id>
<phase>package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreMissingFile>false</ignoreMissingFile>
<filesToInclude>${project.build.directory}/classes/META-INF/native-image/com.datastax.oss/java-driver-core/reflection.json,${project.build.directory}/shaded-sources/META-INF/native-image/com.datastax.oss/java-driver-core/reflection.json</filesToInclude>
<replacements>
<replacement>
<token>io.netty</token>
<value>com.datastax.oss.driver.shaded.netty</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>generate-shaded-manifest</id>
<phase>package</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<instructions>
<Automatic-Module-Name>com.datastax.oss.driver.core</Automatic-Module-Name>
<Bundle-SymbolicName>com.datastax.oss.driver.core</Bundle-SymbolicName>
<!--
Allow importing code from other packages
(so reflection-based loading of policies works)
-->
<DynamicImport-Package>*</DynamicImport-Package>
<Import-Package>
<!--
1) Don't import packages shaded in the driver bundle. Note that shaded-guava lives
in its own bundle, so we must explicitly *not* mention it here.
-->!com.datastax.oss.driver.shaded.netty.*, !com.datastax.oss.driver.shaded.fasterxml.jackson.*,
<!--
2) Don't include the packages below because they contain annotations only and are
not required at runtime.
-->!net.jcip.annotations.*, !edu.umd.cs.findbugs.annotations.*,
<!--
3) Don't include GraalVM.
-->!org.graalvm.*, !com.oracle.svm.*,
<!--
4) Use resolution:=optional whenever possible in order to make it possible to use
the OSS driver without such dependencies in an OSGi environment, as long as the
application does not attempt to access their packages.
Note: dependencies marked as optional are by default included with optional
resolution in the manifest; we only need to manually set the resolution to
optional for dependencies declared as non-optional in the pom files.
-->jnr.*;resolution:=optional, com.esri.core.geometry.*;resolution:=optional,org.reactivestreams.*;resolution:=optional, org.apache.tinkerpop.*;resolution:=optional, org.javatuples.*;resolution:=optional, reactor.blockhound.*;resolution:=optional,
<!--
5) Don't import packages imported by shaded classes, if they are not used by the
driver bundle.
-->!com.google.protobuf.*, !com.jcraft.jzlib.*, !com.ning.compress.*, !lzma.sdk.*, !net.jpountz.xxhash.*, !org.bouncycastle.*, !org.conscrypt.*, !org.apache.commons.logging.*, !org.apache.log4j.*, !org.apache.logging.log4j.*, !org.eclipse.jetty.*, !org.jboss.marshalling.*, !sun.misc.*, !sun.security.*, !com.barchart.udt.*, !com.fasterxml.aalto.*, !com.sun.nio.sctp.*, !gnu.io.*, !org.xml.sax.*, !org.w3c.dom.*, !com.aayushatharva.brotli4j.*, !com.github.luben.zstd.*, *
</Import-Package>
<!--
Export:
1) The driver's packages (API and internal);
2) All shaded packages, except Guava which resides in a separate bundle.
-->
<Export-Package>com.datastax.oss.driver.api.core.*, com.datastax.oss.driver.internal.core.*, com.datastax.dse.driver.api.core.*, com.datastax.dse.driver.internal.core.*, com.datastax.oss.driver.shaded.netty.*, com.datastax.oss.driver.shaded.fasterxml.jackson.*,</Export-Package>
</instructions>
<rebuildBundle>true</rebuildBundle>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>generate-final-shaded-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<!-- this is the manifest generated by the bundle plugin -->
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<descriptors>
<descriptor>src/assembly/shaded-jar.xml</descriptor>
</descriptors>
<!-- Replace the original artifact -->
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>