簡體   English   中英

maven部署文件的使用

[英]Usage of maven deploy-file

閱讀文檔。 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> ,但是當我運行時:

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 方工件時:

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

如果您有特定版本,則可以添加版本 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/"

插件“使用”頁面(https://maven.apache.org/plugins/maven-deploy-plugin/usage.html狀態:

如果未以某種方式指定以下所需信息,則目標將失敗:

  • 要部署的工件文件
  • 要部署的文件的組、工件、版本和打包。 這些可以從指定的 pomFile 中獲取,並使用命令行覆蓋或指定。 當 pomFile 包含 parent 部分時,如果沒有為當前項目或在命令行上進一步指定 groupId,則可以考慮 parent 的 groupId。
  • 存儲庫信息:url 部署到和 repositoryId 映射到 settings.xml 文件中的服務器部分。 如果您不指定 repositoryId,Maven 將嘗試使用 id 'remote-repository' 提取身份驗證信息。

因此,您要么需要指定坐標,要么需要提供 POM 文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM