Artifact function doesn't support folder
fowlie opened this issue · 5 comments
I need to include all jar files inside a folder.
${artifact(project.file("$project.buildDir/jars"))}
The artifact function returned the correct path (e.g. artifacts/[module]/build/jars), but it copied the files wrong. All the jar files were copied into "artifacts/[module]/build", and they were all named "jars" (though they were not the same file, file sizes were correct despite the wrong file name).
I think the bug is in DarTask.groovy:194. There, when calling f.getName()
, f
is not a file but a directory.
I don't think uploading file.Folder
artifacts by referencing a folder inside the DAR package is going to work. We should in fact create a ZIP file containing all files from the given folder, and put that into DAR package. I'm have a look when I have time.
Thanks for tip! I got around the issue by creating a fat jar of the dependencies.
Does File.Folder works apart from artifacts? Right now we use File.Folder to add different folders in the DAR. Will that work with this plugin?
@cooolmagic, it will not include the contents of the folder - that's the issue we had. If you for some reason need empty folders, then it would work I guess.
At least we ended up using Groovy's MarkupBuilder to create our own manifest file in xml, and then it was really simple to create the rest of the dar package with Gradle.
Closing inactive issue