Tomcat deployment: Intellij ignore context.xml and keep pick one from windows temp folder
Hi,
I am trying to deploy a war into a remote Tomcat container. My problem is that intellij keep setting as web path the maven artifact name.
I do not want this behavior but, instead, I want to be able to choose my own path on which my web app should be reachable. In order to do that I created a context.xml file where I specify a context. My problem is that Intellij Idea keep ignoring this file and it always upload a context.xml file from Windows temporary folder (C:\Users\MyUser\AppData\local\temp\ArtifactName-context-xml\ArtifactName.xml).
On Idea I set a Tomcat configuration, within deployment tab I added my artifact. On Project Structure windows I then configured, on Facets tab, a Tomcat Context Descriptor and I gave him the path to the context.xml file. I have also added configured Idea to add a custom context.xml file within the war. However it is still not working.
Any Intelijj Ideas?
请先登录再写评论。
Can you show the "Deployment" tab of your run configuration? What application context is defined here?
https://i.imgur.com/DohCzyn.png
Thanks for your attachment! The problem was my fault.
When I open the deployment tab, the small section that contains the list of stuff to deploy, has the same size of the deployment view. Then I also use a dark theme, hence my scroll bar is almost invisible, and I did not see the "Application Context"section.
Sorry and thanks for your help!
I am having the same problem. I tried changing the default path in the Application Context section, but Tomcat keeps setting the default path
05-Feb-2021 13:59:23.377 INFO [http-nio-8080-exec-4] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /TestWebApp_war_exploded
whereas the application context specifies:
@Konstantin Annikov can you help?
Gkapagunta Please share a sample project to reproduce the issue: https://uploads.jetbrains.com .
Uploaded the sample project here
Upload id: 2021_02_05_VaQQPCnXfhRZu2J7 (file: TestWebApp.zip)
I am using IntelliJ IDEA 2019.2.4 (Ultimate Edition)
Build #IU-192.7142.36, built on October 29, 2019
Gkapagunta
Thanks, bug reported at https://youtrack.jetbrains.com/issue/IDEA-261464 . See the issue description for the workaround.
Serge Baranov thank you!
Another workaround is to downgrade to Apache TomEE 8.0.5