如何将独立的 POM 上传到 Azure 工件?

问题描述 投票:0回答:1

之前我已使用

成功将POM文件上传到Azure Artifacts
mvn  org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy-file     
-Dpackaging=jar    
-DrepositoryId=repoID    
-Durl=https://pkgs.dev.azure.com/path    
-DgroupId=groupId    
-DartifactId=artifactId    
-Dversion=version     
-Dfile=artifactId-version.jar
-DpomFile=artifactId-version.pom

这工作得很好,但问题是我现在必须上传一个只有 POM 而没有 JAR 的工件 https://repository.jboss.org/org/jboss/resteasy/resteasy-jaxrs-all/3.0.19.Final/

我尝试过,但失败了

mvn  org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy-file    
-Dpackaging=jar       
-DrepositoryId=repoID       
-Durl=https://pkgs.dev.azure.com/path    
-DgroupId=org.jboss.resteasy     
-DartifactId=resteasy-jaxrs-all        
-Dversion=3.0.19.Final     
-DpomFile=resteasy-jaxrs-all-3.0.19.Final.pom    

我收到以下错误

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- deploy:2.4:deploy-file (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.793 s
[INFO] Finished at: 2024-01-25T16:05:39+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy-file (default-cli) on project standalone-pom: The parameters 'file' for goal org.apache.maven.plugins:maven-deploy-plugin:2.4: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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException
azure maven jar pom.xml azure-artifacts
1个回答
0
投票

file
是 Apache Maven Deploy Plugin 中的必需参数。请参阅deploy:deploy-file的详细信息。要发布仅包含 pom 且不包含 jar 的工件,您可以将
packaging
的值更改为
pom
并将
file
设置为您的 pom 文件。例如,

mvn deploy:deploy-file -Dpackaging=pom -DrepositoryId=YourRepoID -DgroupId=YourGroupID -DartifactId=YourArtifactID -Dversion=7.0-SNAPSHOT -DpomFile=pom.xml -Dfile=pom.xml

检查Azure工件中的包,仅发布了pom。

© www.soinside.com 2019 - 2024. All rights reserved.