Shermans's Notes
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

January 24th, 2020

  • java
    • When creating a fat Jar care needs to be taken with any singed .jars
    • Firstly if there are any signatures in META-INF the Jar will not run due to security failures
    • Second if if you exclude the signing files, signed jars will not be loaded at run time due to failing the security check
    • You can exclude the files like so
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
task createServerAppJar(type: ShadowJar) {
	classifier = "server"
	from sourceSets.main.output
	configurations = [project.configurations.runtimeClasspath]
	
	manifest {
		attributes (
			"Main-Class"	:	"uk.shermanrose.utils.HttpServer"
		)
	}

	//	Remove BC signatures which cause other classes to fail to load 
	exclude 'META-INF/*.RSA'
	exclude 'META-INF/*.SF' 
	exclude 'META-INF/*.DSA'
}