我有一个Jenkins工作,其中一个任务是uploadArchives,它应该将生成的.aar文件上传到Artifactory仓库。
但是我看到了这个错误
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':libmodule:uploadArchives'.
Could not publish configuration 'archives'
Error deploying artifact 'com.companyname:mylib:aar': Error deploying artifact: /var/empty/.m2/repository/com/companyname/mylib/1.0.0/mylib-1.0.0.aar (No such >file or directory)
Try:
Run with --info or --debug option to get more log output.
build.gradle的相关部分
repositories {
maven{
url 'http://artifacts.companyname.com/repository/android-shared-sandbox'
}
}
def aarFile = file('build/libs/mylib.aar')
artifacts {
archives aarFile
}
//Specify the URL and credentials to deploy the aar to the maven repository
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://artifacts.companyname.com/repository/android-shared-sandbox"){
authentication(userName: "username", password: "changeme")
}
pom.project {
groupId 'com.companyname'
artifactId 'mylib'
packaging 'aar'
version '1.0.0'
}
}
}
}
这可以在笔记本电脑上的命令行中使用,也适用于笔记本电脑上的本地jenkins安装。我假设我在这里遗漏了一些简单的东西,但我无法弄清楚为什么Jenkins试图将它安装到一些本地maven repo而不是build.gradle任务指定的on