tomcat7:deploy fails if IntelliJ is running
I'm in the process of switching over from Eclipse to IntelliJ for a legacy JSP project. I'm able to run maven on the command line normally when IntelliJ is open but whenever I attempt to run the command mvn tomcat7:deploy I get the following error message:
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project website: Tomcat return http status error: 404, Reason Phrase: Not Found: <!doctype html><title>404 Not Found</title><h1 style="text-align: center">404 Not Found</h1><hr/><p style="text-align: center">IntelliJ IDEA 2017.1.4</p> -> [Help 1]
I'm using Tomcat 8, not the embedded version. I'm assuming a setting is being overridden while the application is running but can't seem to find where.
Please sign in to leave a comment.
Do you have an active Run configuration for Tomcat in IntelliJ IDEA when it happens?
I do. I'm able to connect and debug the code as expected.
Why do you deploy from Maven instead of using IntelliJ IDEA artifact with hot swap and instant updates? https://www.jetbrains.com/help/idea/2017.1/updating-applications-on-application-servers.html.
When Tomcat is started from IntelliJ IDEA its configuration is customized for deployment and debugging directly from IntelliJ IDEA, it may conflict with what Maven deployment expects. Maven deployment should work properly when Tomcat is started from Maven.
I deploy using Maven as that was my process when using Eclipse, I'm using a remote Tomcat run configuration. I'll see about switching to allow IntelliJ to deploy instead but am still curious why IntelliJ seems to prevent Maven from deploying.
In case of the remote configuration it's not clear why IntelliJ IDEA affects it. Maybe only one client can connect at a time?