Recommended solutions based on your search
If you are using maven you'd like to exclude your binaries from filtering process.
Java Keytool doesn't accept PEM files, you need to convert it to Der before: "openssl x509 -outform der -in certificate.pem -out certificate.der" and to import it to the keystore "keytool -import -alias your-alias -keystore cacerts -file certificate.der"
Solutions on the web
java.io.IOException: Keystore was tampered with, or password was incorrect