Gradle User Guide (Chapter 10:web application QuickStart)
This chapter is being perfected .....
This chapter describes gradle support for Web applications. Gradle provides two plugins for Web application development: The war plug-in and the jetty plugin. The war plug-in extends the Java plugin and builds a war package for your project. The jetty plugin extends the war plug-in and provides the ability to publish your Web project to the jetty container.
- Build a War file
To build the war file, you need to add the war plug-in to your project.
Note: You can find this example in the Samples/webapplication/quickstart directory of the Gradle Publishing library and source files.
This will also add the Java plugin to your project. Run the Gradle build command, which compiles, tests, and packages your project. Gradle will look for and package the source files under Src/main/webapp. The classes you compile and their run-time dependencies are also included in the war package, respectively, in the Web-inf/classes and Web-inf/lib directories.
- Run the Web project
To run the Web project, you need to add the jetty plug-in to your project.
This action adds the war plugin to your project. Running Gradle Jettyrun will publish your Web project into the jetty container. Running Gradle Jettyrunwar builds a war package that you can then run in a separate Web container.
in Progress : Locate the URL, configure the port, edit and reload the source file.
- Summary of Summary
You can find out more about the war plugin in Chapter, the War plugin and the Jetty plugin in Chapter, The Jetty Plugin. You can find more sample Java projects in the Samples/webapplication directory in the Gradle distribution.
Gradle User Guide (Chapter 10:web application QuickStart)