archiveName vs archiveFileName

I was using archiveName of the JarTask liberally in my builds. I wanted to replace that with the now recommended archiveFileName property.

If I have a place where I just need to get the name of the file without its path, how do I do that from archiveFileName ?

The only difference between archiveName and archiveFileName is that the former is a String and the latter is a Property<String> that can be more lazily configured. Any Property (Gradle API 7.3) you might use has the same API where you can get/set the value, so your only difference is jar.archiveName vs. jar.archiveFileName.get().

1 Like