I am learning to create a java ee web application. In intellij idea I created a project using the project wizard: Java Enterprise -> Web Application. Then I created a build file.gradle in the project root, and call the gradle init
, gradle build
in the terminal. Here is the build file.gradle
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'idea'
repositories {
jcenter()
mavenCentral()
}
sourceCompatibility = 1.5
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
testCompile 'junit:junit:4.12'
}
When I add a dependency and do gradle build, they are not loaded into the project. For example, the Gson library is not available in the code. How to tell Gradle to download the libraries so I could use them? What i'm doing wrong?