简体   繁体   English

Maven将文件部署到私有工件

[英]maven deploy-file to private artifactory

I've set up an artifactory and I am able to to deploy my artifacts to it with mvn deploy . 我已经设置了工件,并且可以使用mvn deploy工件部署到其中。

However, I am unable to to deploy-file , which I am easily able to install: 但是,我无法deploy-file ,可以轻松安装:

mvn install:install-file -Dfile=my.jar -DgroupId=org.group -DartifactId=art -Dversion=3.0-SNAPSHOT -Dpackaging=jar

When I try: 当我尝试:

mvn deploy:deploy-file -Durl=http://myartifactory/artifactory/repositoryId -DrepositoryId=repositoryId -Dfile=my.jar -DgroupId=org.group -DartifactId=art -Dversion=3.0-SNAPSHOT -Dpackaging=jar

I always get: 我总是得到:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project standalone-pom: Failed to retrieve remote metadata org.directwebremoting:dwr:3.0.0-rc3-SNAPSHOT/maven-metadata.xml: Could not transfer metadata org.directwebremoting:dwr:3.0.0-rc3-SNAPSHOT/maven-metadata.xml from/to repository (http://triphop:8081/artifactory/repository): Access denied to: http://triphop:8081/artifactory/repository/org/directwebremoting/dwr/3.0.0-rc3-SNAPSHOT/maven-metadata.xml -> [Help 1]

In the log of the artifactory I am getting: 在工件的日志中,我得到:

20130809142431|0|REQUEST|non_authenticated_user|GET|/repository/org/group/art/3.0-SNAPSHOT/maven-metadata.xml|HTTP/1.1|401|0

Why the maven is trying to fetch the meta data? 为什么行家试图获取元数据? Why it does not upload them? 为什么不上传它们?

Maven 3 works with non unique snapshots only. Maven 3仅适用于非唯一快照。 Which means, it needs to know how to name your snapshot. 这意味着,它需要知道如何命名快照。 The naming depends on what's already in repository. 命名取决于存储库中已有的内容。 That's the reason it downloads the metadata. 这就是它下载元数据的原因。

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

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