Environment Profiles
I've been trying to search for the answer but haven't really found anything. My question is this: Is there a way to configure IntelliJ to build depending on the environment, i.e. Prod vs. Dev. Let's say I have a "resources" directory with a file such as persistence.xml. That file points to a particular database, but, I want to be able to include another persistence.xml that points to another database for development purposes. I'd like to do this without having to keep modifying the persistence.xml file as it can become a risk and hinderance with source control. Any ideas on how to go about this? I also use gradle for command line builds for extra information on my environment.
Any help, ideas, and advice is most welcomed.
Please sign in to leave a comment.
Enable Delegate IDE build/run actions to gradle in IDE Gradle | Runner settings and use Gradle properties to define build logic in build.gradle files. For more information about Gradle "Profiles" see
https://blog.gradle.org/maven-pom-profiles
https://stackoverflow.com/q/25674272/2000323