The problem here is that the property file we use has insanely huge name as the key and most of us run into incorrect key naming issues . so it got me thinking if there\'s a
I would not generate a class or interface from properties because you would lose the abilities to :
You can also use enums, or create some special Property
class, with a name as only and final field. Then, you only need a get
method that would take a Properties
, a Map
or whatever.
As for your request, you can execute code with the maven-exec-plugin.
You should simply create a main that would read your properties file, and for each keys:
_
)Since it would be a part of your build, say before building other classes that would depends on those constants, I would recommend you to create a specific maven project to isolate those build.
Still, I would really don't do that and use a POJO loaded with whatever need (CDI, Spring, Static initialization, etc).