I am using the Exec Maven Plugin to run a main method when using a specific profile. For example:
mvn process-resources -Psomeprofile
In this method, I want to be able to run code that performs operations on my database using my application code, however the database is not connected at this point. I normally use spring for resource injections of some service classes, but that is also not possible since main()
is static. Is there some way to load my applicationContexts and have my application built and run a program through maven?