Is it possible to provide an Application Context when deploying war files

Answered

We have a project that contains multiple test applications. For ease of use, we are deploying them with the application context /ajax.

So when I create a “run configuration” for tomcat, I add the artifact and then have to manually specify the “Application Context” to “/ajax”, because the project name/file name of the war file is quite long (think “com.company.testapps.java.gen2” long) and the suggestion of the application context is “/Gradle___com_company_testapps_java_gen2___com_company_testapps_java_gen2_0_13_0_90000101_000000_war__exploded_”
I found https://youtrack.jetbrains.com/issue/IDEA-120242, which talks about using the file name as the default value there (and that is working fine), but I DON'T want that, I would like to specify that somehow.
 

I had a look at what IntelliJ IDEA does, when I set up the run configuration:

  • It creates a folder “C:\Users\<user>\AppData\Local\JetBrains\IntelliJIdea2023.2\tomcat\9213406f-1f0f-41fc-9747-3ee75228aa93\conf\Catalina\localhost”
  • It creates an xml file in this folder with the name shown above
  • The xml file contains <Context path="

Is there a way to make IntelliJ use a specified Application context by adding a file to the project or updating the gradle build somehow? (without renaming the war file, since we have multiple projects that would have the same name then)

0
2 comments

Hello, Simon!

This appears to be a known issue described in IDEA-222248, make sure to upvote it to raise its' priority for the developers.

0

Thanks, that is exactly it!

0

Please sign in to leave a comment.