我正在尝试从 gradle 为 Springboot 应用程序创建的胖 jar 中排除 application.properties。我可以在 Maven 中做到这一点。Gradle 是项目的首选构建工具。我试图在 'jar' 任务中使用 exclude。它不工作。还有其他建议吗?
plugins {
id 'org.springframework.boot' version '2.2.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'}
group = 'com.prasad'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
}
jar {
exclude('application.properties')
//tried this too exclude('src/main/resources/application.properties')
}
Run Code Online (Sandbox Code Playgroud)