Go back to the previous directory in shell
cd -
It goes back to the previous directory.
cd $OLDPWD
This can be also used in shell scripts.
cd -
cd $OLDPWD
buildscript {
repositories {
maven { url("https://plugins.gradle.org/m2/") }
}
dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.3.2'
classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release'
}
}
repositories{
mavenLocal()
maven { url("https://plugins.gradle.org/m2/") }
maven { url "https://repo.spring.io/snapshot" }
}
dependencies {
//Groovy
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.3.10'
//Spock Test
compile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.3'
//Test
testCompile group: 'junit', name: 'junit', version: '4.10'
testCompile group: 'org.testng', name: 'testng', version: '6.8.5'
}
i) buildscript dependencies jar file will be downloaded from buildscript repositories.[Project external dependency]ii) root level dependencies jar file will be downloaded from root level repositories.[For project dependency]
gradle-cobertura-plugin
, gradle-lint-plugin
are found from buildscript repos. Those plugins would not be referenced as dependencies for the application code.groovy all jar, junit and testng jar
will be found from root level repositories.maven { url("https://plugins.gradle.org/m2/") }
portion can be used in both blocks. Because they are used for different dependencies.buildscript {
repositories { maven { url("https://plugins.gradle.org/m2/") } }
dependencies {
classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release'
}
}
plugins {
id 'java'
id 'groovy'
id 'maven'
id 'jacoco'
id 'application'
id 'nebula.lint' version '7.4.0'
}
allprojects {
apply plugin: 'nebula.lint'
gradleLint.rules = ['unused-dependency']
}
gradle lintGradle
gradle fixGradleLint
gradle compileJava fixGradleLint
===============================
$ sdk list java
$ sdk install java 7u141-zulu
$ sdk use java 7u141-zulu
$ sdk default java 7u141-zulu
===============================
$ sdk list java
$ sdk install java 7u141-zulu
$ sdk use java 7u141-zulu
$ sdk default 7u141-zulu
rizvi@rizvi-pc:~$ sdk list java
============================================
Available Java Versions
============================================
* 9.0.1-zulu
9.0.1-oracle
9.0.0-zulu
8u152-zulu
8u151-oracle
8u144-zulu
8u131-zulu
* 7u141-zulu
* 6u93-zulu
=========================================================
+ - local version
* - installed
> - currently in use
=========================================================
$ sdk install gradle 4.3
$ sdk install gradle 3.0
$ sdk use gradle 4.3
$ sdk default gradle 4.3
===============================
$ sdk list java
$ sdk install java 6u93-zulu
$ sdk use java 6u93-zulu
$ sdk default 6u93-zulu
===============================
$ sdk list java
$ sdk install java 6u93-zulu
$ sdk use java 6u93-zulu
$ sdk default 6u93-zulu
rizvi@rizvi-pc:~$ sdk list java
============================================
Available Java Versions
============================================
* 9.0.1-zulu
9.0.1-oracle
9.0.0-zulu
8u152-zulu
8u151-oracle
8u144-zulu
8u131-zulu
7u141-zulu
* 6u93-zulu
=========================================================
+ - local version
* - installed
> - currently in use
=========================================================
$ sdk install gradle 4.3
$ sdk install gradle 3.0
$ sdk use gradle 4.3
$ sdk default gradle 4.3
$ curl -s get.sdkman.io | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
sdkman 5.0.0+51