简体   繁体   English

如何将单个文件从 Gradle 上传到服务器

[英]How do I upload a single file to a server from Gradle

I have looked everywhere for this seemingly simple task but can find no way to do it without either Maven or Ivy, neither of which I want to use.我到处寻找这个看似简单的任务,但找不到没有 Maven 或 Ivy 的方法,我不想使用这两个。 I just want to find a way to create a task that can upload an arbitrary file to a server without needing metadata of any sort besides credentials to the server, the file path and the URL.我只想找到一种方法来创建一个任务,该任务可以将任意文件上传到服务器,而无需除了服务器凭据、文件路径和 URL 之外的任何类型的元数据。 I realize I could write this in Groovy but I feel like there must be some built in way to do this with a Gradle task that doesn't involve hacking.我意识到我可以在 Groovy 中编写它,但我觉得必须有一些内置的方法来使用不涉及黑客的 Gradle 任务来做到这一点。 Thank you very much for reading this far!非常感谢您阅读到这里!

A simple google search found this: https://gist.github.com/chilicat/6486392 .一个简单的谷歌搜索找到了这个: https : //gist.github.com/chilicat/6486392 This and the reference in the comment should be enough options.这和评论中的参考应该是足够的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM