gradle-tomcat-plugin icon indicating copy to clipboard operation
gradle-tomcat-plugin copied to clipboard

howto: Use tomcatRun with no web.xml (WebApplicationInitializer)

Open davidlund opened this issue 10 years ago • 3 comments

Hi,

We trying to use tomcatRun on tomcat7 on a webapp that uses a WebApplicationInitializer and hence has no web.xml. This doesn't seem to work using tomcatRun but does work using tomcatRunWar - are we missing something. Heres the config we're using:

[tomcatRun,tomcatRunWar]*.contextPath="/"

davidlund avatar Jul 30 '14 13:07 davidlund

From my perspective it should work except if there's a bug. Can you provide me with additional information?

  • What exactly is not working? Do you see any error message/exception?
  • What version of the plugin are you using?
  • Can you provide me with an example project that demonstrates the issue?

Does #64 describe the same issue you are seeing?

bmuschko avatar Jul 30 '14 22:07 bmuschko

For the record, this skeleton uses WebApplicationInitializer and has no web.xml, and has no troubles with the tomcat gradle plugin.

jeanbza avatar Sep 10 '15 01:09 jeanbza

Just as a comment, I hit a quirk that I think is the same or related issue. I create a very simple Servlet using only the @WebServlet annotation, and provide no web.xml. When you run this using the tomcatRunWar task it works fine. But if you run using the tomcatRun task the servlet is not reachable. If I create an essentially empty web.xml then it now works OK.

tdudgeon avatar May 11 '18 13:05 tdudgeon

Closing as issue got no traction.

bmuschko avatar Sep 24 '23 02:09 bmuschko