【问题标题】:Using Maven-JarJar plugin使用 Maven-JarJar 插件
【发布时间】:2016-01-12 15:36:07
【问题描述】:

我正在尝试使用 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


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-20
      • 2011-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-30
      相关资源
      最近更新 更多