Gradle User Guide (Chapter 10:web application QuickStart)

Source: Internet
Author: User

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.

  1. 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.

  2. 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.

  3. 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.