我有一个build.gradle脚本,其中包含以下部分,用于将工件上传到私有版Maven回购:
uploadArchives {
repositories {
mavenDeployer {
repository(url: "/opt/maven_repo/private-release") {
pom.artifactId = archive
}
}
}
}
我在unix机器上运行构建,并且用户具有对目录/ opt / maven_repo / private-release的写访问权。但是,任务失败并显示以下输出:
:uploadArchives
Uploading: company-name/artifact-name/relX.N/artifact-name-relX.N.jar to repository remote at /opt/maven_repo/private-release
Specified destination directory cannot be created: /company-name/artifact-name/relX.N
:uploadArchives FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':uploadArchives'.
> Could not publish configuration 'archives'
> Error deploying artifact 'artifact-name:jar': Error deploying artifact: Specified destination directory cannot be created: /company-name/artifact-name/relX.N
P.S。:工件实际上放在〜/ .m2 / repository中,我觉得它试图在根目录而不是指定的存储库目录中创建目录