1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ ~
4
+ ~ Copyright 2024 tosit.io
5
+ ~
6
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
7
+ ~ you may not use this file except in compliance with the License.
8
+ ~ You may obtain a copy of the License at
9
+ ~
10
+ ~ http://www.apache.org/licenses/LICENSE-2.0
11
+ ~
12
+ ~ Unless required by applicable law or agreed to in writing, software
13
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
14
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ ~ See the License for the specific language governing permissions and
16
+ ~ limitations under the License.
17
+ ~
18
+ -->
19
+ <!--
20
+ OKDP spark docker images add-ons:
21
+ * Manage compatibilty (transitive) dependency versions between Hadoop, spark and extensions.
22
+ * Prevents mixing extensions (e.x.hadoop-aws) version with other hadoop artifacts from different
23
+ versions.
24
+ * Manage AWS SDK V2 and SDK V1 for S3 (breaking changes between SDK V1 and V2) versions.
25
+ * Using teh hadoop-project as parent is complex
26
+ * See also: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-project-maven.html
27
+ * See also: https://hadoop.apache.org/docs/stable/hadoop-aws/tools/hadoop-aws/aws_sdk_upgrade.html
28
+ * See also: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html
29
+ * See also: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup-project-maven.html
30
+
31
+ hadoop version < 3.4: https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-bundle (aws sdk
32
+ v1)
33
+ hadoop version >= 3.4: https://github.com/aws/aws-sdk-java-v2/blob/master/bundle/pom.xml (aws sdk
34
+ v2)
35
+ -->
36
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
37
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
38
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
39
+ <modelVersion >4.0.0</modelVersion >
40
+ <name >OKDP AWS SDK for Java - Minio Bundle</name >
41
+ <groupId >com.amazonaws</groupId >
42
+ <artifactId >okdp-minio-aws-s3-bundle</artifactId >
43
+ <version >${aws-java-sdk.version}</version >
44
+ <packaging >jar</packaging >
45
+ <description >
46
+ OKDP AWS SDK for Java - Minio Bundle
47
+ The bundle contains S3 service only with around 6.5MB instead of +350MB (+540MB in v2 bundle)
48
+ </description >
49
+ <properties >
50
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
51
+ </properties >
52
+ <profiles >
53
+ <profile >
54
+ <!-- aws java sdk v1 bundle can take up 350MB! -->
55
+ <!-- https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-bundle/pom.xml -->
56
+ <id >minio-aws-java-sdk-s3-v1</id >
57
+ <activation >
58
+ <property >
59
+ <name >aws-sdk-profile.version</name >
60
+ <value >v1</value >
61
+ </property >
62
+ </activation >
63
+ <dependencies >
64
+ <dependency >
65
+ <groupId >com.amazonaws</groupId >
66
+ <artifactId >aws-java-sdk-s3</artifactId >
67
+ <version >${aws-java-sdk.version}</version >
68
+ </dependency >
69
+ <!--
70
+ S3Guard was removed since Hadoop 3.3.5 (https://issues.apache.org/jira/browse/HADOOP-17409)
71
+ But spark still depends on the previous hadoop versions < 3.3.5 (ex.: spark 3.5.1 => hadoop 3.3.4)
72
+ -->
73
+ <dependency >
74
+ <groupId >com.amazonaws</groupId >
75
+ <artifactId >aws-java-sdk-dynamodb</artifactId >
76
+ <version >${aws-java-sdk.version}</version >
77
+ </dependency >
78
+ </dependencies >
79
+ <build >
80
+ <plugins >
81
+ <plugin >
82
+ <groupId >org.apache.maven.plugins</groupId >
83
+ <artifactId >maven-shade-plugin</artifactId >
84
+ <executions >
85
+ <execution >
86
+ <phase >package</phase >
87
+ <goals >
88
+ <goal >shade</goal >
89
+ </goals >
90
+ <configuration >
91
+ <shadedArtifactAttached >false</shadedArtifactAttached >
92
+ <promoteTransitiveDependencies >true</promoteTransitiveDependencies >
93
+ <artifactSet >
94
+ <includes >
95
+ <include >joda-time:joda-time</include >
96
+ <include >com.fasterxml.jackson.core:*</include >
97
+ <include >com.fasterxml.jackson.dataformat:jackson-dataformat-cbor</include >
98
+ <include >org.apache.httpcomponents:*</include >
99
+ <include >commons-codec:commons-codec</include >
100
+ <include >commons-logging:commons-logging</include >
101
+ <include >io.netty:*</include >
102
+ <include >com.amazonaws:*</include >
103
+ </includes >
104
+ </artifactSet >
105
+ <relocations >
106
+ <relocation >
107
+ <pattern >org.joda</pattern >
108
+ <shadedPattern >com.amazonaws.thirdparty.joda</shadedPattern >
109
+ </relocation >
110
+ <relocation >
111
+ <pattern >com.fasterxml.jackson</pattern >
112
+ <shadedPattern >com.amazonaws.thirdparty.jackson</shadedPattern >
113
+ </relocation >
114
+ <relocation >
115
+ <pattern >org.apache.http</pattern >
116
+ <shadedPattern >com.amazonaws.thirdparty.apache.http</shadedPattern >
117
+ </relocation >
118
+ <relocation >
119
+ <pattern >org.apache.commons.codec</pattern >
120
+ <shadedPattern >com.amazonaws.thirdparty.apache.codec</shadedPattern >
121
+ </relocation >
122
+ <relocation >
123
+ <pattern >org.apache.commons.logging</pattern >
124
+ <shadedPattern >com.amazonaws.thirdparty.apache.logging</shadedPattern >
125
+ </relocation >
126
+ <relocation >
127
+ <pattern >io.netty</pattern >
128
+ <shadedPattern >com.amazonaws.thirdparty.io.netty</shadedPattern >
129
+ </relocation >
130
+ </relocations >
131
+ </configuration >
132
+ </execution >
133
+ </executions >
134
+ </plugin >
135
+ </plugins >
136
+ </build >
137
+ </profile >
138
+ <profile >
139
+ <!-- aws java sdk v2 bundle can take up 500MB! -->
140
+ <!-- https://github.com/aws/aws-sdk-java-v2/blob/master/bundle/pom.xml -->
141
+ <id >minio-aws-java-sdk-s3-v2</id >
142
+ <activation >
143
+ <property >
144
+ <name >aws-sdk-profile.version</name >
145
+ <value >v2</value >
146
+ </property >
147
+ </activation >
148
+ <dependencies >
149
+ <dependency >
150
+ <groupId >software.amazon.awssdk</groupId >
151
+ <artifactId >s3</artifactId >
152
+ <version >${aws-java-sdk.version}</version >
153
+ </dependency >
154
+ </dependencies >
155
+ <build >
156
+ <plugins >
157
+ <plugin >
158
+ <groupId >org.apache.maven.plugins</groupId >
159
+ <artifactId >maven-shade-plugin</artifactId >
160
+ <executions >
161
+ <execution >
162
+ <phase >package</phase >
163
+ <goals >
164
+ <goal >shade</goal >
165
+ </goals >
166
+ <configuration >
167
+ <shadedArtifactAttached >false</shadedArtifactAttached >
168
+ <promoteTransitiveDependencies >true</promoteTransitiveDependencies >
169
+ <artifactSet >
170
+ <includes >
171
+ <include >com.fasterxml.jackson.jr:*</include >
172
+ <include >io.netty:*</include >
173
+ <include >org.apache.httpcomponents:*</include >
174
+ <include >org.reactivestreams:*</include >
175
+ <include >org.slf4j:*</include >
176
+ <include >commons-codec:commons-codec</include >
177
+ <include >software.amazon.awssdk:*</include >
178
+ <include >software.amazon:*</include >
179
+ <include >software.amazon.s3.accessgrants:*</include >
180
+ <inlcude >com.github.ben-manes.caffeine:*</inlcude >
181
+ <include >commons-logging:*</include >
182
+ </includes >
183
+ </artifactSet >
184
+ <relocations >
185
+ <relocation >
186
+ <pattern >org.apache</pattern >
187
+ <shadedPattern >software.amazon.awssdk.thirdparty.org.apache</shadedPattern >
188
+ <excludes >
189
+ <exclude >org.apache.log4j.*</exclude >
190
+ </excludes >
191
+ </relocation >
192
+ <relocation >
193
+ <pattern >io.netty</pattern >
194
+ <shadedPattern >software.amazon.awssdk.thirdparty.io.netty</shadedPattern >
195
+ </relocation >
196
+ <relocation >
197
+ <pattern >org.slf4j</pattern >
198
+ <shadedPattern >software.amazon.awssdk.thirdparty.org.slf4j</shadedPattern >
199
+ </relocation >
200
+ </relocations >
201
+ </configuration >
202
+ </execution >
203
+ </executions >
204
+ </plugin >
205
+ </plugins >
206
+ </build >
207
+ </profile >
208
+ </profiles >
209
+ </project >
0 commit comments