【发布时间】:2023-03-05 05:04:01
【问题描述】:
我正在将基于 Gradle 的 Android 项目转换为 Maven,并且在包含 SimpleXML Framework 时遇到了障碍。
在 Gradle 中,我可以在导入库时指定以下内容:
compile('org.simpleframework:simple-xml:2.7.+') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
请问如何在 Maven 中执行此操作?我曾尝试使用 Shade 插件,但我认为我把它弄得一团糟。这是我的尝试:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>stax</exclude>
<exclude>stax-api</exclude>
<exclude>xpp3</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】: