Given a set of properties files and list of files which may reference keys in those properties files, what's the easiest way to determine which keys are unused?
Example:
Given a project with files
muppets.properties
kermit=Kermit the Frog
oscar=Oscar the Grouch
smurfs.properties
papa=Papa Smurf
and /WEB-INF/pages/template.jsp
Some jsp template displaying the key <bean:write bundle='muppets' key='kermit'/>.
then running program with inputs "*.properties" and "/WEB-INF/**/*.jsp" should report
Unused properties:
muppets.properties
oscar
smurfs.properties
papa
What's the simplest way to do this? Are there any open-source Java libraries that make this easy? The idea is to embed the solution inside an in-house Maven reporting plugin that would run when building a web app.
I'm aware that there will be false positives (key strings appearing in the files in a non-key context), but that's ok. Being able to find any unused keys would be helpful.
Edit: I'm seeking a standalone code-base solution.