Giriş
Bu plugin şu şekilde kullanılabilir
1. Gradle 5 öncesi Spring Boot Plugin İle Kullanım
2. Gradle 5 sonrası bu plugin'e gerek yok
3. Tek Başına Kullanım
Gradle 5 Öncesi Spring Boot Plugin İle Kullanım
Açıklaması şöyle. Yani bu kullanımda otomatik olarak spring-boot'u da getirmiş oluyoruz
When you apply the io.spring.dependency-management plugin, Spring Boot’s plugin will automatically import the spring-boot-dependencies bom from the version of Spring Boot that you are using. This provides a similar dependency management experience to the one that’s enjoyed by Maven users. For example, it allows you to omit version numbers when declaring dependencies that are managed in the bom. To make use of this functionality, declare dependencies in the usual way but omit the version number:
Örnek
Şöyle yaparız. Burada bill of materials (BOM) kullanılıyor
plugins {
id "org.springframework.boot" version "2.1.5.RELEASE"
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}
Örnek
Şöyle yaparız
plugins {
id "io.spring.dependency-management" version <<version>>
}
dependencyManagement {
imports {
// The plugin already brings spring-boot-dependencies BOM,
// We can also add other BOMs like:
mavenBom 'another:dependency-bom:2.0.0'
}
}
dependencies {
// Then, now we can simply declare the dependencies we need
// without having to worry about their versions
implementation 'org.apache.kafka:connect-api'
implementation 'com.rabbitmq:amqp-client'
}
Hiç yorum yok:
Yorum Gönder