使用Maven-JarJar插件

时间:2016-01-12 15:36:07

标签: maven jarjar

我正在尝试使用Maven JarJar插件,但我遇到了问题。 我想要做的是将杰克逊图书馆作为我的“依赖罐子”的一部分。

由于我无法找到帮助,我正在尝试猜测配置。你能看一看并告诉我我做错了吗?

这是配置:

<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]

我将感激你的帮助!

1 个答案:

答案 0 :(得分:0)

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

Relocating fastxml.jackson classes to my.package.fastxml.jackson