Skip to content

Commit 2c3aec2

Browse files
committed
fix: use Maven Shade plugin to relocate fastjson2 package in ngbatis
- Relocate 'com.alibaba.fastjson2' to 'org.nebula.contrib.ngbatis.internal.fastjson2' using Maven Shade plugin during build - This avoids classpath conflicts between fastjson2 (used internally) and fastjson1 which is commonly used in dependent projects - Enables ngbatis to be integrated safely in environments where both fastjson versions coexist without breaking compatibility or causing runtime errors - Addresses issue with fastjson version clashes reported by users
1 parent 839def9 commit 2c3aec2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,39 @@
177177
</configuration>
178178
</plugin>
179179

180+
<!-- Maven Shade Plugin - 重命名 fastjson2 包名 -->
181+
<plugin>
182+
<groupId>org.apache.maven.plugins</groupId>
183+
<artifactId>maven-shade-plugin</artifactId>
184+
<version>3.2.4</version>
185+
<executions>
186+
<execution>
187+
<phase>package</phase>
188+
<goals>
189+
<goal>shade</goal>
190+
</goals>
191+
<configuration>
192+
<relocations>
193+
<relocation>
194+
<pattern>com.alibaba.fastjson2</pattern>
195+
<shadedPattern>org.nebula.contrib.ngbatis.internal.fastjson2</shadedPattern>
196+
</relocation>
197+
</relocations>
198+
<filters>
199+
<filter>
200+
<artifact>*:*</artifact>
201+
<excludes>
202+
<exclude>META-INF/*.SF</exclude>
203+
<exclude>META-INF/*.DSA</exclude>
204+
<exclude>META-INF/*.RSA</exclude>
205+
</excludes>
206+
</filter>
207+
</filters>
208+
</configuration>
209+
</execution>
210+
</executions>
211+
</plugin>
212+
180213
<!-- compiler -->
181214
<plugin>
182215
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)