Java 运行jar时清单主属性的签名文件摘要无效
我正在尝试运行我的项目的jar文件。我在做STS。但每次我试图运行我的jar文件时,它都会给我一个类似异常的错误:发生了JNI错误,请检查您的安装并重试 线程“main”java.lang.SecurityException中出现异常:清单主属性的签名文件摘要无效Java 运行jar时清单主属性的签名文件摘要无效,java,maven,jar,maven-plugin,Java,Maven,Jar,Maven Plugin,我正在尝试运行我的项目的jar文件。我在做STS。但每次我试图运行我的jar文件时,它都会给我一个类似异常的错误:发生了JNI错误,请检查您的安装并重试 线程“main”java.lang.SecurityException中出现异常:清单主属性的签名文件摘要无效 my pom.xml is <plugins> <plugin> <groupId>org.apache.maven.plugins
my pom.xml is
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<!-- <execution> <id>copy-dependencies</id> <phase>prepare-package</phase>
<goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>
${project.build.directory}/${environment}/dependencies ${project.build.directory}/dependency-jars/
</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer> <includeScope>runtime</includeScope>
</configuration> </execution> -->
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<!-- <configuration> <excludeScope>system</excludeScope> <excludes>META-INF/*.SF</excludes>
<excludes>META-INF/*.DSA</excludes> <excludes>META-INF/*.RSA</excludes> <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration> -->
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<!-- Additional configuration. -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/resources
</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>com.emo.process.EmoBatchProcess</mainClass>
<classpathPrefix>dependency-jars/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>EMOBatchProcess</finalName>
<outputDirectory>${basedir}/target/LOCAL</outputDirectory>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>all</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
my pom.xml是
org.apache.maven.plugins
maven依赖插件
2.3
解包依赖项
包裹
解包依赖项
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
maven资源插件
2.5
复制资源
验证
复制资源
${basedir}/target/resources
src/main/resources
真的
org.apache.maven.plugins
maven jar插件
2.4
com.emo.process.EmoBatchProcess
依赖罐子/
org.apache.maven.plugins
maven阴影插件
1.4
包裹
阴凉处
EMOBatchProcess
${basedir}/target/LOCAL
真的
全部的
任何人请帮帮我任何人请帮帮我