maven 部署文件的使用 [英] Usage of maven deploy-file

查看:67
本文介绍了maven 部署文件的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读文档.deploy:deploy-file (https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html),似乎唯一需要的参数是必需参数 , ,尽管如此,当我跑步时:

Reading the doc. of the deploy:deploy-file (https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html), it seems that the only required parameters are Required Parameters <file>, <repositoryId> and <url>, nevertheless when I run :

mvn deploy:deploy-file -Durl={url} -DrepositoryId={repoId} -Dfile=D:\Users\nunito\IdeaProjects\calzada\target\calzada.zip

我收到此错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project oib-kw-guards-web: The artifact i
nformation is incomplete or not valid:
[ERROR]   [0]  'groupId' is missing.
[ERROR]   [1]  'artifactId' is missing.
[ERROR]   [2]  'version' is missing.

推荐答案

我通常在命令行中使用 deploy:deploy-file,当我有一个没有 的第三方工件时pom.xml:

I usually use deploy:deploy-file in command-line, when I have an 3rd-party artifact without its pom.xml:

cmd /v /c "set a=an-artifact-name&& set g=com.company.xxx&& \
mvn deploy:deploy-file -Dfile=C:\path\to\!a!.jar -Dpackaging=jar -DgroupId=!g! -DartifactId=!a! \
-Dversion=1.0-DEV-SNAPSHOT -DrepositoryId=nexus \
-Durl=http://company.com/nexus/content/repositories/company-snapshots/"

你需要做的就是修改命令开头的ag.

All you need to do is to modify a and g at the beginning of the command.

如果您有特定版本,可以添加版本 v,并将其放在 Nexus 的发布部分:

You can add a version v if you have a specific version, and put it in the release part of your Nexus:

cmd /v /c "set a=an-artifact-name&& set g=com.company.xxx&& && set v=1.2.3&& \
mvn deploy:deploy-file -Dfile=C:\path\to\!a!.jar -Dpackaging=jar -DgroupId=!g! -DartifactId=!a! \
-Dversion=!v! -DrepositoryId=nexus \
-Durl=http://company.com/nexus/content/repositories/company-releases/"

这篇关于maven 部署文件的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆