LOC标头无效(签名错误)

问题描述 投票:2回答:1

我在Maven构建期间遇到此错误。

无法执行目标org.apache.maven.plugins:maven-shade-plugin:2.4.3:项目上的阴影(默认)dl4j-examples:创建阴影jar时出错:LOC头部无效(签名错误) - > [帮助1] [错误]

这是我的pom.xml文件。

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>${maven-shade-plugin.version}</version>
            <configuration>
                <shadedArtifactAttached>true</shadedArtifactAttached>
                <shadedClassifierName>${shadedClassifier}</shadedClassifierName>
                <createDependencyReducedPom>true</createDependencyReducedPom>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>org/datanucleus/**</exclude>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>

            </configuration>

            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                <resource>reference.conf</resource>
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我试图多次删除jar文件似乎不起作用。

java maven pom.xml
1个回答
6
投票

我也面临同样的问题,Ben是正确的,这是腐败jar文件的情况。只需转到.m2 repo文件夹并从那里删除它并再次构建它(mvn clean install)。它会解决这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.