使用 Maven-Jarry 插件

Using Maven-JarJar plugin

我正在尝试使用 Maven JarJar 插件,但遇到了问题。 我想做的是将 Jackson 图书馆作为我的一部分 "jar-with-dependcies".

由于找不到帮助,我正在尝试猜测配置。你能看看我做错了什么吗?

这是配置:

<plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>jarjar-maven-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>jarjar</goal>
                    </goals>
                    <configuration>
                        <includes>
                            <include>com.fasterxml.jackson.core:jackson-core</include>
                            <include>com.fasterxml.jackson.core:jackson-databind</include>
                            <include>com.fasterxml.jackson.core:jackson-annotations</include>
                        </includes> 
                        <rules>
                            <rule>
                                <pattern>com.fasterxml.jackson.**</pattern>
                                <result>${my.package.prefix}.com.fasterxml.jackson.@1</result>
                            </rule>
                        </rules>
                    </configuration>
                </execution>
            </executions>
        </plugin>

编译时,我收到以下消息:

Cleaning up unclosed ZipFile for archive C:\Work\Projects\XXXX\target\xxxx-1.0.0-SNAPSHOT.jar[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (assemble-all) on project xxxx: Failed to create assembly: Error creating assembly archive jar-with-dependencies: Problem creating jar: jar:file:/C:/Work/Projects/XXXX/target/xxxx-1.0.0-SNAPSHOT.jar!/META-INF/aop.xml: JAR entry META-INF/aop.xml not found in C:\Work\Projects\XXXX\target\xxxx-1.0.0-SNAPSHOT.jar -> [Help 1]

非常感谢你的帮助!

最后我没有用maven-jarjar-plugin。我已经使用了 JarJar 的 JAR 本身。 以下问题的答案描述了解决方案: