gradle - Gradle 任务:复制依赖项、重命名和取消归档
问题描述
我的要求是从 maven 下载 java 依赖项并将每个要提取的 jar 重命名并重命名为不同的名称。
task downloadOutput() {
doLast {
def downloadsDir = "${buildDir}/output/"
copy {
from configurations.mydependencies
rename { fileName -> filename + "-l2"
}
into file(downloadsDir)
}
}
}
添加from zipTree (configuration.mydependencies)
也失败并出现以下错误。
Execution failed for task ':downloadOutput'.
> Cannot convert the provided notation to a File or URI: configuration ':mydependencies'.
The following types/formats are supported:
- A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
- A String or CharSequence URI, for example 'file:/usr/include'.
- A File instance.
- A Path instance.
- A Directory instance.
- A RegularFile instance.
- A URI or URL instance.
如何修复这个 zipTree?有不同的方法或api吗?
解决方案
推荐阅读
- python - 从组合变量创建新变量
- javascript - 检索快速查看表单值 - Dynamics CRM JavaScript
- aws-sdk-nodejs - 如何为 aws4 签名请求存根 sinon
- python - 每次测试后如何让 Sphinx doctest 重置 Django 数据库?
- c - 我的简单利息计算器由于某种原因无法正常工作
- boto3 - AWS Lambda 使用 boto3.client('iot-data') TIMEOUT as of 2021-01-26
- python - 使用 Python ftplib 将内存中的 numpy 图像数组上传到 FTP 服务器会导致一个空文件
- android - PWA 能否拥有原生应用程序的用户体验和外观?
- reactjs - react如何显示状态组件的内容
- python - 背景减法器在 OpenCV Python 中不起作用,该怎么办?