如何使用gradle将工件上传到网络驱动器? [英] How to upload artifact to network drive using gradle?
问题描述
我正在阅读:
http://www.gradle.org/docs/current/userguide/artifact_management.html
了解如何发布/上传我的神器到网络驱动器/ fileshare这是一个要求(我们有一个maven repo启动并运行,但一些文物需要转储到文件共享)。我发现的例子更多地集中在部署到仓库,maven,ivy等。
我有一个简单的eclipse java项目,我使用gradle 1.2构建,内容如下build.gradle文件:
apply plugin:'java'
sourceSets {
main {
java {
srcDir'src'
}
}
测试{
java {
srcDir'test'
}
}
}
存储库{
flatDir {
名称fileRepo
dirsfile://internal.newtwork.drive/folder/test
}
}
uploadArchives {
repositories {
add project.repositories.fileRepo
}
}
在Gradle文档中,我可以阅读如何将资源复制到远程文件共享的信息?
我试着根据下面的答案更新协议和dir属性,但是我得到这个错误:
- 出了什么问题:
任务':uploadArchives'的执行失败。
$ b
无法发布配置':archives'。
java.io.FileNotFoundException:/internal.newtwork.drive/folder/test/sample-gradle-java-unspecified.jar(没有这样的文件或目录)
目的地是否正确,flatDir repo不支持networkdrives?
解决方案您应定义以下参数:
archivesBaseName ='yourappname'
group ='your.app.package'
version ='1.0.0'
I am reading this:
http://www.gradle.org/docs/current/userguide/artifact_management.html
to understand how to publish/upload my artifact to a network drive/fileshare which is a requirement (we have a maven repo up and running but some artifacts needs to be dumped on a fileshare). The examples I have found are more focused on deploying to repositories, maven, ivy, etc.
I have a simple eclipse java project that I build using gradle 1.2 with the following build.gradle file:
apply plugin: 'java' sourceSets { main { java { srcDir 'src' } } test { java { srcDir 'test' } } } repositories { flatDir { name "fileRepo" dirs "file://internal.newtwork.drive/folder/test" } } uploadArchives { repositories { add project.repositories.fileRepo } }
Where in the gradle docs can I read about how to copy resources to a remote fileshare?
I have tried to update the protocol and the dir attribute based on the below answers but I get this error:
- What went wrong:
Execution failed for task ':uploadArchives'.
Could not publish configuration ':archives'. java.io.FileNotFoundException: /internal.newtwork.drive/folder/test/sample-gradle-java-unspecified.jar (No such file or directory)
解决方案You should define the following parameters:
archivesBaseName = 'yourappname' group = 'your.app.package' version = '1.0.0'
这篇关于如何使用gradle将工件上传到网络驱动器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- What went wrong:
Execution failed for task ':uploadArchives'.