I am having a little trouble building jar from gradle project. Namely gradle doesn't include my resource folder even though i have it specified in build.gradle as shown below:
plugins {
id 'application'
}
repositories {
mavenCentral()
}
application {
mainClass = 'skorupinski.xmass.Main'
}
sourceSets {
main {
java {
srcDirs = ['./src/main/java']
}
resources {
srcDirs = ['./src/main/resources']
}
}
}
jar {
manifest {
attributes(
'Main-Class': 'skorupinski.xmass.Main'
)
}
baseName = 'hi'
}
There are images in the resource folder that I load into my java program. When I run the jar file it returns an error that it coudln't file the image file unless i put the jar in the same directory as src folder.