Hello,
I am a gradle newbie…
I need to create a jar file with a special structure:
root
- classes
--- controllers
--- utils
- images
- js
-css
-META-INF
plugin.xml
I have an typical maven directory structure and define my source set this way:
sourceSets {
main {
java {
srcDir 'src/main/java'
}
// groovy {
// srcDir 'src/main/groovy'
// }
}
}
My problem is, that the jarfile created does not have a “classes” directory which contains the ‘controllers’ and ‘utils’ classes.
Additionally, I have no idea how to put the css , images and js-files into the jar.
(The sources reside in /src/main/plugin/css , /src/main/plugin/js and /src/main/images )
I defined the jar task as follows:
// build a jar file
jar {
manifest {
attributes 'Built-By': 'me', 'Implementation-Title': 'VSX thrift plugin'
}
destinationDir = file("$rootDir/dist") // where to create the jar instead of /build/libs
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
configurations.runtime.collect {
it.isDirectory() ? it : zipTree(it)
}
}
from('src/main') {
include '**/*.css'
include '**/*.images'
include '**/*.js'
}
}
Can anyone please explain me how I can create the jar exactly with the structure I need?