I'd like to enforce standardized keys by storing them as static final String variables on a Java class, and either referencing or statically importing them, to use them as values in either XML, Strings, Methods, Annotations, etc.
Does anyone know a good way to have Maven insert (like filtering) values like StringKeys.SOME_KEY into an XML file? e.g. something like
<element value="${StringKeys.SOME_KEY}"/>
or similar - the main idea is to enforce commonality and prevent key mis-alignment. Or an alternative solution to accomplish the same - with some semantic that if a non-existant String is referenced, that it fails during build? Bonus points if it works in C# as well.