Chapter 3. Building a Web Application

Now that we have seen the ease of using Gradle for building a command-line Java application, we shouldn't be surprised to know that building web applications based on Java servlet specification is also equally easy with Gradle.

In this chapter, we will build a simple web application first, which is distributed as a WAR file that can be deployed to any servlet container. Then, we will take a look at how dependencies and repositories are configured in a build file.

Building a simple Java web project

Again, we will keep our application as minimal as possible and create a web-enabled version of the application, which we developed in the last chapter. The application will provide the user a form to input their name ...

Get Gradle Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.