Only two steps, configure Gretty plugin in Gradle

Source: Internet
Author: User
Tags testng jcenter

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}

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: info-contact@alibabacloud.com 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.