gradle 打包所有依赖 Invalid signature file digest for Manifest main attributes(转)

时间:2024-12-03 09:07:31

1.打包所有依赖:

// 指定main函数的类

jar {

manifest

{

  attributes "Main-Class": "com.baeldung.fatjar.Application" }

  from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }

}

}

遇到问题: Invalid signature file digest for Manifest main attributes

When using spark-submit to run a jar, you may encounter this error:

Invalid signature file digest for Manifest main attributes

The error occurs when one of the included libraries in the jar's META-INF directory has a bad signature.

Solve the error with this command:

zip -d <jar file name>.jar META-INF/*.RSA META-INF/*.DSA META-INF/*.SF