1

我有一个使用 maven shade 插件的 maven 模块,它正在构建一个 uber.jar。模块本身没有源代码,但构建了一个 jar (local.jar)。现在,当我运行 mvn install 时,构建按预期工作会生成 shaded(uber.jar) jar,但我必须排除所有传递依赖项,因此将“minimizejar”设置为 true。现在构建选择空的 local.jar 并尝试将其最小化,并在此过程中引发异常

“创建阴影 jar 时出错:version.txt 的 SHA1 摘要错误”

这是我的 pom 中的阴影插件声明

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <executions>
    <execution>
        <id>shade-uber</id>
        <phase>package</phase>
        <goals>
          <goal>shade</goal>
        </goals>
        <configuration>
        <minimizeJar>true</minimizeJar>
       <shadedArtifactAttached>false</shadedArtifactAttached>
        <filters>
        <filter>
            <artifact>*:*</artifact>
            <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
                <exclude>META-INF/*</exclude>
            </excludes>
        </filter>
    </filters>
          <outputFile>target/uber.jar</outputFile>
          <artifactSet>
            <includes>
        <include>abc.*:*</include>
    </includes>

我也尝试生成一个 local.pom,但是这次阴影步骤给出了一个空指针异常,我不明白如何从阴影过程中排除 local.jar。local.jar 为空且未签名。

非常感谢这里的任何帮助。

4

0 回答 0