shell or groovy script to create Java class during maven compile

137 views Asked by At

i am planning to execute a script file during maven compilation of my project. The script shall look at a properties file and using the values in there, it should create a Java class (with static final Strings which have the values from properties files as values) which can be used later on within the project.

what would be the best way to do this?

Once compiled the Java file should be visible from within the IDE. I was thinking about using gmaven plugin, but i am not sure whether it is possible to create files with it. Otherwise i will have to use bash script or similar to create Java file.

thanks for any advice or opinion

1

There are 1 answers

0
sakal On BEST ANSWER

i ended up using gmaven plugin to run a groovy script, and then i used maven build helper plugin to include the generated source code in compilation.