Too troublesome can be downloaded directly, put under the project can.
two files 0 points download: Click to download 1. Add a Gretty.plugin file to the project
Note that is under the project, not under SRC
Gretty.plugin Code
Buildscript {
repositories {
jcenter ()
}
dependencies {
classpath ' Org.akhikhl.gretty:gretty : 1.2.4 '
}
}
repositories {
jcenter ()
}
if (!project.plugins.findplugin ( Org.akhikhl.gretty.GrettyPlugin))
project.apply (Plugin:org.akhikhl.gretty.GrettyPlugin)
2. Add code to Build.gradle
Add apply from: ' Gretty.plugin '
Build.gradle Complete code
/* * This build file is auto generated by running the Gradle ' init ' task * by ' Administrator ' at ' 17-4-20 pm 8:21 ' with
Gradle 2.11 * * This generated file contains a sample Java project to get you started. * For more details take a look at the Java Quickstart chapter in the Gradle * User Guide available at Https://docs.gradle
. org/2.11/userguide/tutorial_java_projects.html *//Apply the Java plugin to add support for Java Apply plugin: ' java ' Apply plugin: ' War ' on ' Apply from: ' Gretty.plugin '//' on ' section declare where to find the dependencies of your PR
Oject repositories {//use ' jcenter ' for resolving your dependencies.
You can declare any maven/ivy/file repository here. Jcenter ()}//-section Declare the dependencies for your production and test code dependencies {//the P Roduction code uses the SLF4J logging API at compile time compile ' org.slf4j:slf4j-api:1.7.14 '//Declare the DEP Endency for your favourite test frameworK you want to use in your tests. TestNG is also supported by the Gradle Test task. Just Change the//Testcompile dependency to Testcompile ' org.testng:testng:6.8.1 ' and add//' test.usetestng () ' t
o Your build script. Testcompile ' junit:junit:4.12 '}//configuration Gretty gretty {port = 8888 ContextPath = "" Servletcontainer = ' tomcat8 ' DebugPort = 5005//Default Debugsuspend = TRUE//Default httpsenabled = True Httpsport = 4430}