Skip to content

Commit 661488c

Browse files
committed
Exclude SLF4J and Log4J from iceberg-aws-bundle (#244)
1 parent 24c3442 commit 661488c

File tree

2 files changed

+53
-13
lines changed

2 files changed

+53
-13
lines changed

flink-sql-runner/pom.xml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
<scope>provided</scope>
7373
</dependency>
7474

75-
<!-- Will be shipped as Flink lib -->
7675
<dependency>
7776
<groupId>org.apache.iceberg</groupId>
7877
<artifactId>iceberg-aws-bundle</artifactId>
@@ -452,41 +451,48 @@
452451
<plugin>
453452
<groupId>org.apache.maven.plugins</groupId>
454453
<artifactId>maven-dependency-plugin</artifactId>
455-
<version>3.8.1</version>
456454
<executions>
457455
<execution>
458-
<id>copy-s3-fs-hadoop</id>
456+
<id>unpack-iceberg-aws-bundle-without-logging</id>
459457
<goals>
460-
<goal>copy-dependencies</goal>
458+
<goal>unpack</goal>
461459
</goals>
462460
<phase>process-resources</phase>
463461
<configuration>
464-
<includeGroupIds>org.apache.flink</includeGroupIds>
465-
<includeArtifactIds>flink-s3-fs-hadoop</includeArtifactIds>
466-
<outputDirectory>${project.build.directory}</outputDirectory>
462+
<artifactItems>
463+
<artifactItem>
464+
<groupId>org.apache.iceberg</groupId>
465+
<artifactId>iceberg-aws-bundle</artifactId>
466+
<version>${iceberg.version}</version>
467+
<type>jar</type>
468+
<overWrite>true</overWrite>
469+
<outputDirectory>${project.build.directory}/iceberg-aws-bundle-temp</outputDirectory>
470+
<excludes>org/apache/logging/**,org/slf4j/**</excludes>
471+
</artifactItem>
472+
</artifactItems>
467473
</configuration>
468474
</execution>
469475
<execution>
470-
<id>copy-iceberg-runtime</id>
476+
<id>copy-s3-fs-hadoop</id>
471477
<goals>
472478
<goal>copy-dependencies</goal>
473479
</goals>
474480
<phase>process-resources</phase>
475481
<configuration>
476-
<includeGroupIds>org.apache.iceberg</includeGroupIds>
477-
<includeArtifactIds>iceberg-flink-runtime-1.19</includeArtifactIds>
482+
<includeGroupIds>org.apache.flink</includeGroupIds>
483+
<includeArtifactIds>flink-s3-fs-hadoop</includeArtifactIds>
478484
<outputDirectory>${project.build.directory}</outputDirectory>
479485
</configuration>
480486
</execution>
481487
<execution>
482-
<id>copy-iceberg-aws-bundle</id>
488+
<id>copy-iceberg-runtime</id>
483489
<goals>
484490
<goal>copy-dependencies</goal>
485491
</goals>
486492
<phase>process-resources</phase>
487493
<configuration>
488494
<includeGroupIds>org.apache.iceberg</includeGroupIds>
489-
<includeArtifactIds>iceberg-aws-bundle</includeArtifactIds>
495+
<includeArtifactIds>iceberg-flink-runtime-1.19</includeArtifactIds>
490496
<outputDirectory>${project.build.directory}</outputDirectory>
491497
</configuration>
492498
</execution>
@@ -551,6 +557,26 @@
551557
</execution>
552558
</executions>
553559
</plugin>
560+
561+
<!-- Repackage iceberg-aws-bundle without SLF4J using antrun plugin -->
562+
<plugin>
563+
<groupId>org.apache.maven.plugins</groupId>
564+
<artifactId>maven-antrun-plugin</artifactId>
565+
<executions>
566+
<execution>
567+
<id>repack-iceberg-aws-bundle</id>
568+
<goals>
569+
<goal>run</goal>
570+
</goals>
571+
<phase>prepare-package</phase>
572+
<configuration>
573+
<target>
574+
<jar basedir="${project.build.directory}/iceberg-aws-bundle-temp" destfile="${project.build.directory}/iceberg-aws-bundle-${iceberg.version}.jar"/>
575+
</target>
576+
</configuration>
577+
</execution>
578+
</executions>
579+
</plugin>
554580
</plugins>
555581
</build>
556582

pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@
117117
<central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
118118
<exec-maven-plugin.version>3.5.1</exec-maven-plugin.version>
119119
<license-maven-plugin.version>5.0.0</license-maven-plugin.version>
120-
<maven-enforcer-plugin.version>3.6.1</maven-enforcer-plugin.version>
120+
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
121+
<maven-dependency-plugin.version>3.9.0</maven-dependency-plugin.version>
122+
<maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
121123
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
122124
<maven-javadoc-plugin.version>3.11.3</maven-javadoc-plugin.version>
123125
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
@@ -245,12 +247,24 @@
245247
<version>${sundr-maven-plugin.version}</version>
246248
</plugin>
247249

250+
<plugin>
251+
<groupId>org.apache.maven.plugins</groupId>
252+
<artifactId>maven-antrun-plugin</artifactId>
253+
<version>${maven-antrun-plugin.version}</version>
254+
</plugin>
255+
248256
<plugin>
249257
<groupId>org.apache.maven.plugins</groupId>
250258
<artifactId>maven-enforcer-plugin</artifactId>
251259
<version>${maven-enforcer-plugin.version}</version>
252260
</plugin>
253261

262+
<plugin>
263+
<groupId>org.apache.maven.plugins</groupId>
264+
<artifactId>maven-dependency-plugin</artifactId>
265+
<version>${maven-dependency-plugin.version}</version>
266+
</plugin>
267+
254268
<plugin>
255269
<groupId>org.apache.maven.plugins</groupId>
256270
<artifactId>maven-failsafe-plugin</artifactId>

0 commit comments

Comments
 (0)