My server runs a Java application that requires I replace a few java library files with ones I downloaded on my own. This has to do with JCE security extensions and isn't really relevant to my question.
I've found that these library files tend to get overwritten by apt when it later updates my java package.
Is there an apt-friendly way of masking these specific files so apt won't touch them?
Potential Solutions
I'm considering just removing the write flag from the files, though I'm expecting this will cause apt to spew its guts everywhere when it later tries to overwrite them?
Perhaps there's a java custom library directory I don't know of, where I can park my files and they'll be loaded instead of the package's defaults?
The last-resort option I'm considering is writing a cron job to periodically replace the files with my versions. I hate this option.
Detailed Explanation
We're operating a fairly heavy Java web application (customized build of GeoServer). The application encrypts user data using the Java Cryptography Extension.
The version of JCE that apt installs is an international version, however, this version is relatively crippled. There is another version (that we have to use). This version is only allowed to be installed in certain locales. We have installed it by replacing the default JCE jars (in /usr/lib/jvm/java-7-oracle/jre/lib/security
) with the appropriate versions of these jars that we require. It's these two particular jar files under this location that get periodically replaced by apt and end up breaking our application. In turn, I'm afraid to run software updates.