Gradle Tutorial
Introduction Installation Creating project using command line Simple gradle project in IntelliJ IDEA build.gradle file settings.gradle file Directory structure of Gradle project Built-in tasks User defined tasks Task dependencies Running gradle tasks Grouping tasks Repository management in Gradle Declaring dependencies in Gradle JUnit TestNG Test execution reports in Gradle Creating executable Jar using Gradle Generating project API documentation in Gradle Publishing and deployment of artifact in GradleDeclaring dependencies in gradle
We can declare dependencies in Gradle as shown below. Each dependency must be declared with 3 co-ordinates.- Group Id – Name of organisation that has developed this library
- Artifact name – Name of the artifact (jar)
- Artifact version
dependencies {
compile group: 'joda-time', name: 'joda-time', version: '2.9.4'
compile 'commons-io:commons-io:2.5'
testCompile 'junit:junit:4.12'
runtime files('libs/iolib.jar', 'libs/xmllib.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
}
Each dependency has a specific scope of dependency- compile
- runtime
- testCompile
- testRuntime
Web development and Automation testing
solutions delivered!!