Given a (versioned) Gradle project that builds a war, I want to deploy it to a local tomcat using IntelliJ IDEA.
This works fine at the moment, except the name of the IntelliJ artifact generated by the Gradle IntelliJ plugin includes the version number of my project. This means at each release I need to update the Tomcat run configuration in IntelliJ (even worse, each time I switch branch, e.g. when doing bugfixes in 1.2.x and new features in 1.x…).
It seems I need to specify the artifact name in “Run > Edit Configurations… > Tomcat > Deployment tab”, so I’m currently looking for a way to remove the version number from that artifact name. However, being able to say “use whatever artifact from current project” (e.g. with a regex) would also be fine.
So far, I tried to ignore the IntelliJ artifacts generated by the Gradle IntelliJ plugin and instead configure my own artifact in “Project Settings > Artifacts”. This also “works”, but as I couldn’t find a way to tell IntelliJ to put “all runtime dependencies of module X” in WEB-INF/lib, I had to give it the list of those dependencies. So now, instead of being required to update my configuration each time my project version changes, I need to do it each time a dependency changes.
NB: I’m using the Gradle plugin bundled in IntelliJ, not the IDEA Gradle plugin.