I am building a shaded jar from dependencies and while using this shaded jar, I came across this exception:
Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file
I was able to fix it by excluding the signed jars from shaded jar and using those jars directly but I came across following SO questions on the same topic:
Maven shade jar throw exception
How can I exclude *.DSA and *.SF files from shaded jar?
"Invalid signature file" when attempting to run a .jar
Valid JAR signature for JavaFX projects
which suggest that we can resolve the problem by excluding the files that sign these jars.
But my question is, is that the right and legal way ? For example, one of the signed jars that I was using was mssql-jdbc-6.4.0.jre7.jar
signed by Microsoft. Microsoft must have signed it for legal and/or security reasons.
Is my understanding wrong?