2020年3月14日 星期六

build.gradle exclude "META-INF/*.RSA"

https://stackoverflow.com/questions/49519467/execute-jar-with-included-dependencies-using-gradle

task BuildJar(type: Jar) {
    manifest {
        attributes(
                'Main-Class': 'org.mycompany.mainclass'             
        )
    }
    classifier = 'all'
    baseName = 'MyJar'
    from {
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
         }
            {
                exclude "META-INF/*.SF"
                exclude "META-INF/*.DSA"
                exclude "META-INF/*.RSA"
            }
    with jar

}