May 25, 2021 Gradle
This chapter describes Gradle's support for Web engineering. G radle provides two main plug-ins for web development, War plugin and Jetty plugin. W here War plugin is inherited from Java plugin, it can be used to play war packages. Jetty plugin is inherited from War plugin as a container for engineering deployments.
You need to package the War file, you need to use War plugin in your script:
build.gradle
apply plugin: 'war'
Note: This sample code can be found under the samples/webApplication/quickstart path in the Gradle distribution package.
Because it inherits from the Java plug-in,
when you perform the gradle build,
your project is compiled, tested, and packaged. G
radle looks
src/main/webapp
The compiled classes file and runtime dependencies are also included in the War package.
Groovy web build
You can use multiple plug-ins in a single project. F or example, you can use both War plugin and Groovy plugin in web engineering. The plug-in adds the Gradle dependency to your War package.
To start a web project, simply use Jetty plugin:
build.gradle
apply plugin: 'jetty'
Since Jetty plugin inherits from War plugin. C alling gradle jettyRun will deploy your project startup to the jetty container. Calling gradle jettyRunWar packages and starts deployment to the jetty container.
To be added: Which URL to use, configure the port, where to use the source file, edit your file, and reload the content.