I would like my uploaded archive to simply have the name “foo.jar”. instead of “foo-${version}.jar”. How can I achieve this? My build script is simply as below, which results in the archive being written as “foo-unspecifiedVersion.jar”. Setting version to null or ‘’ does not help.
that changes the jar file name when it is built (jar task), but i want to be able to specify the jar name when it is uploaded via the uploadArchives task.
I still get foo-unspecified.jar when doing your suggestion.
Forgive me if I’m missing something, but isn’t that specifically for uploading to a maven repository? I’m uploading to a local flatDir and am not having difficulty uploading multiple jars. Specifically, I’m having trouble in that the upload task does not respect the version or the archiveName properties of an artifact.
It’s not clear why you’d be using the upload task to copy jars into a ‘flatDir’ repository. Are you using generated ivy.xml metadata files or Maven Pom files, or just the jar files?
If you only need jar files, you might find a simple copy task works better than ‘uploadShared’. If you require the metadata files, then you should be using an ‘ivy’ or ‘maven’ repository with a ‘file’ URL.
The ‘Upload’ task has been designed around publishing artifacts to a structured repository. You might be able to use it to copy files into an unstructured folder (like flatDir) but it wasn’t specifically designed for such use.
After collaboration with a couple coworkers, we came to the same conclusion this afternoon with success. I was stuck in the mindset of our flat directory as a repository, and of taking advantage of built-in tasks. Thanks for your input!