阅读文档。的deploy:deploy-file
( https://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
我收到此错误:[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
的第 3 方 Artifact 时:
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/"
您需要做的就是修改a
和 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/"
关于maven - maven 部署文件的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63504381/