End goal is build two jars, one with just the application*.yml files and the other the application files and dependent jars without the application*yml files.
When I initially defined
jar {
processResources.exclude('application*.yml')
}
The (SpringBootTests) tests started failing where they were expecting the property files and they were not present.
Looked everywhere, but couldn’t find a solution, so came up with a separate build.gradle (release.gradle) to do this. All good, except, by design apparently, the --build-file=release.gradle ignores the settings.gradle and I loose the rootProject.name assignment. My CI pipeline now fails to find the jar files.
I tried amending release.build to be
jar {
archiveBaseName = 'ciExpectedName'
processResources.exclude('application*.yml')
}
and then
jar {
processResources.exclude('application*.yml')
}
assemble {
jar.archiveBaseName = 'ciExpectedName'
}
Application archive name still wrong.
This DOES work - but ONLY for the resources.
task resourcesJar(type: Jar) {
archiveBaseName = 'ciExpectedName'
archiveClassifier = 'resources'
from sourceSets.main.resources
include('application*.yml')
dependsOn configurations.runtimeClasspath
}
I tried to then add --settings-file=settings.gradle to be informed
Sorry if this is a newbie question, but I have searched everywhere to no avail. I have the following setup
build.parent.gradle
build.gradle
release.gradle
settings.gradle
src\main\java
src\main\resources
src\test\java
src\test\resources\
Using gradlew; and I think the version is 6.6
Hope someone can assist!
Cheers… Andrew