bmuschko / gradle-tomcat-plugin

Gradle plugin supporting deployment of your web application to an embedded Tomcat web container
Apache License 2.0
530 stars 125 forks source link

Support for any `web.xml` location #179

Closed lapo-luchini closed 6 years ago

lapo-luchini commented 6 years ago

It seems to me that web.xml is always searched for in uriroot/WEB-INF/web.xml while it could be defined elsewhere, e.g. I'm using:

war {
    webInf { from 'etc' }
    from('WebContent')
}

Would it be possible to support that? (if it is already, sorry, but I couldn't find it)

bmuschko commented 6 years ago

At the moment the plugin only uses the conventional directory from the War Plugin. That is org.gradle.api.plugins.WarPluginConvention:webAppDir. Your proposal would only work if you'd run the task tomcatRunWar. The task tomcatRun doesn't even build a WAR file. It simply points to directories. Did you run the task tomcatRunWar?

lapo-luchini commented 6 years ago

Sorry I forgot parts of my question: I'm using tomcatJasper as I only need to "test" my JSPs, I don't deploy from gradle (up to today, at least).

In the meantime I also tried calling JspC directly from ant… and it's the same, so I guess the limit is really Jasper and not this plugin, really. :-/

bmuschko commented 6 years ago

You could try to set validateXml to false and see if that ignores your web.xml. I guess you don't want to verify the web.xml? At the moment validateXml is not exposed by the task.

lapo-luchini commented 6 years ago

Yes, doesn't really need the XML per se, problem is, it needs to use the correct directory because there are TLDs in a subdirectory. In the end I solved it using a copy task to put *.jsp and WEB-INF in the expected positions.