Maven:无法将第三方JAR部署到远程存储库

Dav*_*ave 7 maven-2 maven

我正在使用Maven 3.我正在尝试将第三方工件部署到远程存储库但是我遇到了一个奇怪的错误.我用来部署的命令是

mvn deploy:deploy-file -DgroupId=com.myco.util.ant \
  -DartifactId=selenium-ant-task \
  -Dversion=1.4 \
  -Dpackaging=jar \
  -Dfile=/Users/davea/.m2/repository/com/myco/util/ant/selenium-ant-task/1.4/selenium-ant-task-1.4.jar \
  -DrepositoryId=sonatype-nexus \
  -Durl=http://sonatype.myco.com/nexus/content/repositories/releases
Run Code Online (Sandbox Code Playgroud)

我运行此命令时得到的错误是

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file (default-cli) on project maven-selenium-plugin: The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file are missing or invalid -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
Run Code Online (Sandbox Code Playgroud)

这里发生了什么?我在〜/ .m2/settings.xml文件中定义了我的repositoryId,"ssonatype-nexus",并验证了其中的凭据是否正确.

谢谢你的帮助, - 戴夫

Ton*_*ony 1

看来您的网址格式不正确。

尝试:

-Durl=文件://path_to_m2_repo

请参阅此处了解更多信息

编辑:请注意,在本例中,该 URL 用于本地存储库。Maven 应根据 POM 和 -DrepositoryId 部署到 Nexus。