Java Reference
In-Depth Information
ing with Gradle is its large variety of available plugins. In this chapter I'm working with
web applications, and Gradle understands their structure as well as regular Java or Groovy
applications. Allyouneedtodoisincludethe war plugin,andeverythingworks.Evenbet-
ter, Gradle also includes a jetty plugin, which is designed for testing web applications.
Simply add the following line to a Gradle build:
apply plugin:'war'
The project will then use the default Maven structure of a web application. That means
the web directory src/main/webapp will hold any view layer files, like HTML, CSS, and
JavaScript. That directory will also contain the WEB-INF subdirectory, which contains the
web deployment descriptor, web.xml. The source structure can be mapped any way you
want, but for this section I'll stick with the default Maven approach.
Consider a web application that holds HelloServlet from the previous section. The
project layout is shown in figure 10.4 .
Search WWH ::




Custom Search