I have a libs.version.toml
file as
[versions]
boot-version = '3.1.4'
cloud-version = '2022.0.4'
openapi-version = '2.2.0'
[libraries]
spring-boot-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "boot-version" }
spring-boot-actuator = { module = 'org.springframework.boot:spring-boot-starter-actuator' }
spring-boot-data-jpa = { module = 'org.springframework.boot:spring-boot-starter-data-jpa' }
spring-boot-data-redis = { module = 'org.springframework.boot:spring-boot-starter-data-redis' }
spring-boot-security = { module = 'org.springframework.boot:spring-boot-starter-security' }
spring-boot-oauth2-resource-server = { module = 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' }
spring-boot-test = { module = 'org.springframework.boot:spring-boot-starter-test' }
spring-boot-validation = { module = 'org.springframework.boot:spring-boot-starter-validation' }
spring-boot-web = { module = 'org.springframework.boot:spring-boot-starter-web' }
spring-boot-web-services = { module = 'org.springframework.boot:spring-boot-starter-web-services' }
spring-cloud-bom = { module = 'org.springframework.cloud:spring-cloud-dependencies', version.ref = 'cloud-version' }
spring-cloud-bootstrap = { module = 'org.springframework.cloud:spring-cloud-starter-bootstrap' }
spring-cloud-config = { module = 'org.springframework.cloud:spring-cloud-starter-config' }
spring-cloud-eureka-client = { module = 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' }
spring-cloud-openfeign = { module = 'org.springframework.cloud:spring-cloud-starter-openfeign' }
spring-kafka = { module = 'org.springframework.kafka:spring-kafka' }
spring-session-data-redis = { module = "org.springframework.session:spring-session-data-redis", version = "3.1.2" }
openapi = { module = 'org.springdoc:springdoc-openapi-starter-webmvc-ui', version.ref = 'openapi-version' }
oracle = { module = 'com.oracle.database.jdbc:ojdbc8' }
h2 = { module = 'com.h2database:h2' }
poi-ooxml = { module = 'org.apache.poi:poi-ooxml', version = '5.2.4' }
[bundles]
microservice = ['openapi', 'spring-boot-actuator', 'spring-boot-data-jpa', 'spring-boot-validation', 'spring-boot-web',
'spring-cloud-config', 'spring-cloud-eureka-client', 'spring-cloud-bootstrap', 'oracle']
[plugins]
spring-boot-plugin = { id = 'org.springframework.boot', version.ref = 'boot-version' }
spring-dependency-management-plugin = { id = 'io.spring.dependency-management', version = '1.1.3' }
and I publish it to our company nexus with maven-publish plugin,
Then I have a spring boot microservice, with following build.gradle:
plugins {
id 'java'
alias(libs.plugins.spring.boot.plugin)
alias(libs.plugins.spring.dependency.management.plugin)
}
group = 'my.project.name'
version = '6.0.0'
sourceCompatibility = JavaVersion.VERSION_17
dependencies {
implementation platform(libs.spring.cloud.bom)
implementation libs.bundles.microservice
compileOnly libs.lombok
testCompileOnly libs.lombok
annotationProcessor libs.lombok
testAnnotationProcessor libs.lombok
testImplementation libs.spring.boot.test
testRuntimeOnly libs.h2
}
test {
useJUnitPlatform()
jvmArgs = ["-Xss8m"]
}
when I create Spring boot fat jar many of dependencies are missing, but when I add them by name they are not missing. Why this happens?