Skip to content

Commit 93bc8bd

Browse files
authored
[Improve][build] Improved scope of maven-shade-plugin (#2665)
* [Improve][build] Improved scope of maven-shade-plugin * Excludes log dependencies in maven-shade-plugin * common/base module need skip shading * common/base module need skip shading
1 parent 34ccfd7 commit 93bc8bd

File tree

12 files changed

+210
-14
lines changed

12 files changed

+210
-14
lines changed

pom.xml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@
581581
<createDependencyReducedPom>true</createDependencyReducedPom>
582582
<!-- Make sure the transitive dependencies are written to the generated pom under <dependencies> -->
583583
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
584+
<artifactSet>
585+
<excludes>
586+
<exclude>org.slf4j:*</exclude>
587+
<exclude>ch.qos.logback:*</exclude>
588+
<exclude>log4j:*</exclude>
589+
</excludes>
590+
</artifactSet>
584591
<filters>
585592
<filter>
586593
<artifact>*:*</artifact>
@@ -600,9 +607,9 @@
600607
<goal>shade</goal>
601608
</goals>
602609
<configuration>
603-
<transformers>
604-
<transformer
605-
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
610+
<transformers combine.children="append">
611+
<!-- The service transformer is needed to merge META-INF/services files -->
612+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
606613
</transformers>
607614
</configuration>
608615
</execution>
@@ -807,17 +814,6 @@
807814
<artifactId>scala-maven-plugin</artifactId>
808815
</plugin>
809816

810-
<plugin>
811-
<groupId>org.apache.maven.plugins</groupId>
812-
<artifactId>maven-shade-plugin</artifactId>
813-
</plugin>
814-
815-
<!-- make sure that flatten runs after maven-shade-plugin -->
816-
<plugin>
817-
<groupId>org.codehaus.mojo</groupId>
818-
<artifactId>flatten-maven-plugin</artifactId>
819-
</plugin>
820-
821817
<plugin>
822818
<groupId>org.apache.maven.plugins</groupId>
823819
<artifactId>maven-surefire-plugin</artifactId>

seatunnel-connectors-v2/connector-common/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,30 @@
2828
<modelVersion>4.0.0</modelVersion>
2929

3030
<artifactId>connector-common</artifactId>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.apache.maven.plugins</groupId>
36+
<artifactId>maven-shade-plugin</artifactId>
37+
<executions>
38+
<execution>
39+
<phase>package</phase>
40+
<goals>
41+
<goal>shade</goal>
42+
</goals>
43+
<!-- common module need skip shading -->
44+
<configuration>
45+
<skip>true</skip>
46+
</configuration>
47+
</execution>
48+
</executions>
49+
</plugin>
50+
<!-- make sure that flatten runs after maven-shade-plugin -->
51+
<plugin>
52+
<groupId>org.codehaus.mojo</groupId>
53+
<artifactId>flatten-maven-plugin</artifactId>
54+
</plugin>
55+
</plugins>
56+
</build>
3157
</project>

seatunnel-connectors-v2/connector-dingtalk/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
<groupId>com.aliyun</groupId>
4242
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
4343
<version>${dingtalk.service.version}</version>
44+
<exclusions>
45+
<exclusion>
46+
<artifactId>log4j</artifactId>
47+
<groupId>log4j</groupId>
48+
</exclusion>
49+
</exclusions>
4450
</dependency>
4551
</dependencies>
4652

seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,30 @@
118118
</dependency>
119119

120120
</dependencies>
121+
122+
<build>
123+
<plugins>
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-shade-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<phase>package</phase>
130+
<goals>
131+
<goal>shade</goal>
132+
</goals>
133+
<!-- base module need skip shading -->
134+
<configuration>
135+
<skip>true</skip>
136+
</configuration>
137+
</execution>
138+
</executions>
139+
</plugin>
140+
<!-- make sure that flatten runs after maven-shade-plugin -->
141+
<plugin>
142+
<groupId>org.codehaus.mojo</groupId>
143+
<artifactId>flatten-maven-plugin</artifactId>
144+
</plugin>
145+
</plugins>
146+
</build>
121147
</project>

seatunnel-connectors-v2/connector-http/connector-http-base/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,29 @@
6060
</dependency>
6161
</dependencies>
6262

63+
<build>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-shade-plugin</artifactId>
68+
<executions>
69+
<execution>
70+
<phase>package</phase>
71+
<goals>
72+
<goal>shade</goal>
73+
</goals>
74+
<!-- base module need skip shading -->
75+
<configuration>
76+
<skip>true</skip>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
<!-- make sure that flatten runs after maven-shade-plugin -->
82+
<plugin>
83+
<groupId>org.codehaus.mojo</groupId>
84+
<artifactId>flatten-maven-plugin</artifactId>
85+
</plugin>
86+
</plugins>
87+
</build>
6388
</project>

seatunnel-connectors-v2/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@
8585
<skip>true</skip>
8686
</configuration>
8787
</plugin>
88+
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-shade-plugin</artifactId>
92+
</plugin>
93+
94+
<!-- make sure that flatten runs after maven-shade-plugin -->
95+
<plugin>
96+
<groupId>org.codehaus.mojo</groupId>
97+
<artifactId>flatten-maven-plugin</artifactId>
98+
</plugin>
8899
</plugins>
89100
</build>
90101

seatunnel-connectors/seatunnel-connectors-flink-sql/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,18 @@
3333
<module>flink-sql-connector-elasticsearch-7</module>
3434
</modules>
3535

36+
<build>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-shade-plugin</artifactId>
41+
</plugin>
3642

43+
<!-- make sure that flatten runs after maven-shade-plugin -->
44+
<plugin>
45+
<groupId>org.codehaus.mojo</groupId>
46+
<artifactId>flatten-maven-plugin</artifactId>
47+
</plugin>
48+
</plugins>
49+
</build>
3750
</project>

seatunnel-connectors/seatunnel-connectors-flink/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,18 @@
103103
</dependency>
104104
</dependencies>
105105

106+
<build>
107+
<plugins>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-shade-plugin</artifactId>
111+
</plugin>
112+
113+
<!-- make sure that flatten runs after maven-shade-plugin -->
114+
<plugin>
115+
<groupId>org.codehaus.mojo</groupId>
116+
<artifactId>flatten-maven-plugin</artifactId>
117+
</plugin>
118+
</plugins>
119+
</build>
106120
</project>

seatunnel-connectors/seatunnel-connectors-spark/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,18 @@
9696
</dependency>
9797
</dependencies>
9898

99+
<build>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-shade-plugin</artifactId>
104+
</plugin>
105+
106+
<!-- make sure that flatten runs after maven-shade-plugin -->
107+
<plugin>
108+
<groupId>org.codehaus.mojo</groupId>
109+
<artifactId>flatten-maven-plugin</artifactId>
110+
</plugin>
111+
</plugins>
112+
</build>
99113
</project>

seatunnel-core/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,19 @@
3939
<module>seatunnel-flink-starter</module>
4040
<module>seatunnel-spark-starter</module>
4141
</modules>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-shade-plugin</artifactId>
48+
</plugin>
49+
50+
<!-- make sure that flatten runs after maven-shade-plugin -->
51+
<plugin>
52+
<groupId>org.codehaus.mojo</groupId>
53+
<artifactId>flatten-maven-plugin</artifactId>
54+
</plugin>
55+
</plugins>
56+
</build>
4257
</project>

0 commit comments

Comments
 (0)