maven 部署文件的使用

Nuñ*_*ada 6 maven

阅读文档。的deploy:deploy-filehttps://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html),似乎只有必需的参数是必需参数<file>, <repositoryId> and <url>但是当我运行,:

mvn deploy:deploy-file -Durl={url} -DrepositoryId={repoId} -Dfile=D:\Users\nunito\IdeaProjects\calzada\target\calzada.zip
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

[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.
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 4

deploy:deploy-file当我有一个没有它的第三方工件时,我通常在命令行中使用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/"
Run Code Online (Sandbox Code Playgroud)

您需要做的就是修改命令开头的aand 。g

如果您有特定版本,您可以添加版本 v,并将其放在 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/"
Run Code Online (Sandbox Code Playgroud)