I have multi-project build. I collecting all my generated jar in one place by redefined the destinationDir :
tasks.withType(Jar) {
//define directory where the archive is generated into
destinationDir = "new/location"
}
It’s working fine, but
the clean task doesn’t ‘know’ the new location. As result, the generated jar not cleaned by clean task. What is best solution for it? Can I partial override task? Or just create my new clean task?
can you show your whole build.gradle file? “task with that name already exists” is likely thrown because you create a new task instead of configuring an existing one. ensure that the baseplugin (or the java plugin) is applied before adding the script above.
Not sure what is difference between the section you quieted and mine…It’s same In this situation the ‘clean’ task is cleaning only build folder, but not the jar file