Home > OS >  Spring in application.yaml dont see classpath of my lib
Spring in application.yaml dont see classpath of my lib

Time:12-15

i try to use conf files from lib, but applcation.yaml dont see classpath to lib

this is my gradle.build

image of apllication.yaml

plugins { 
  id 'java' 
  id 'org.springframework.boot' version '2.7.6' 
  id 'io.spring.dependency-management' version '1.1.0' 
}

group = 'common' 
version = '0.0.1-SNAPSHOT' 
sourceCompatibility = '8'

configurations { 
  compileOnly { 
    extendsFrom annotationProcessor 
  } 
}

repositories { 
  mavenCentral() 
  flatDir { 
    dirs 'libs' 
  } 
}

dependencies { 
  implementation 'org.springframework.boot:spring-boot-starter-jdbc' 
  implementation 'org.mockito:mockito-core:4.9.0'
  implementation 'org.springframework.boot:spring-boot-starter-web' 
  implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 
  implementation group: 'ma.glasnost.orika', name: 'orika-core', version: '1.5.4' 
  implementation 'common:0.3.2' 
  implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.13' 
  implementation group: 'com.oracle.database.jdbc', name: 'ojdbc8', version: '21.7.0.0' 
  implementation 'org.postgresql:postgresql' 
  implementation 'org.jetbrains:annotations:23.0.0' 
  implementation 'org.springframework.boot:spring-boot-starter-cache:2.7.6' 
  implementation 'org.springframework.boot:spring-boot-starter-data-redis:2.7.6' 
  compileOnly 'org.projectlombok:lombok' 
  annotationProcessor 'org.projectlombok:lombok' 
  testImplementation 'org.springframework.boot:spring-boot-starter-test' 
}

tasks.named('test') { 
  useJUnitPlatform() 
}

Can someome explain me what i do wrong?

CodePudding user response:

Everything you have in libs directory needs to go to src/main/resources. Then it will be visible on the classpath.

  • Related