Is this the easiest way of interacting with maven repositories?


When introducing Gradle to other people, often the first question that gets asked what would be the easiest way to push to a maven repository.

I tried to produce the simplest script that would let you pull and push single files (or rather artifacts). I also wanted to do it without the java plugin, so “no”. Here’s the result, please let me know if there was an even shorter way (i.e. without the AbstractArchiveTask)

You can omit the ‘artifactToUpload’ configuration and ‘artifacts’ block. If the file to be uploaded already exists, you can also omit the ‘createArtifact’ task. Note that ‘into “”’ will create a directory with that name inside the Zip, which is probably not what you want.

Thanks again! Updated it accordingly!