Hello,
I’ve got my build script working just about perfectly. I had to move to the forked/updated goooler.Shadow plugin for Java 21 compatibility, but I’ve got everything running smoothly now. I’m trying to add one final “install” task to update the fatJar in my user directory. My task looks like this:
tasks.register("install") {
dependsOn tasks.shadowJar
def destinationPath = project.gradle.gradleUserHomeDir.path + '/';
def installJar = 'app-util.jar';
doFirst {
System.out.println( "Removing old installed JAR file " + destinationPath)
delete destinationPath + installJar
}
doLast {
System.out.println( "Installing new output into user directory.")
copy {
from shadowJar.outputs.files.singleFile
into destinationPath
rename (shadowJar.outputs.files.singleFile.name, installJar)
}
System.out.println( "Completed install of: " + shadowJar.outputs.files.singleFile )
}
}
The issue I’m now facing is that this simply isn’t updating the JAR. I’m running Gradle from a user-space command prompt (Mac), so I think the ability to delete and move the files would be fine. I don’t get any errors when running, so I’m a little unclear on how to debug and figure out how to fix it.
Any advice or guidance would be much appreciated!
Thanks,
E