From what I've read so far, plugins {} seems to be the way to apply plugins for later Gradle versions where apply plugin: 'name' is the legacy way and we are encouraged to not use it anymore where possible.
However, in my IntelliJ Gradle project, I tried to import Lombok and SpringBoot as below:
plugins {
id 'java'
id 'org.springframework.boot' version '2.0.4.RELEASE'
id 'net.ltgt.apt' version '0.10'
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'com.github.javadev:underscore:1.35'
compileOnly 'org.projectlombok:lombok:1.18.2'
apt "org.projectlombok:lombok:1.18.2"
}
It won't work at all and no packages are added to the External Libraries. So, I had to add the code below in build.gradle for it to work:
apply plugin: 'io.spring.dependency-management'
apply plugin: 'nebula.provided-base'
Is this the right way to go or am I missing something very important?