簡體   English   中英

使用 maven deploy in Azure DevOps 部署工件時未找到傳輸協議

[英]No transfer protocol found while deploying an artifact using maven deploy in Azure DevOps

當我嘗試將 JAR 工件部署到 Azure DevOPS 中的工件提要時,DevOPS 面臨以下問題。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project: No transfer protocol found. -> [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/MojoExecutionException

下面是我的 YAML 代碼:

- task: Maven@3
  displayName: 'Maven Deploy'
  inputs:
   mavenPomFile: 'pom.xml'
   goals: 'deploy:deploy-file'
   options: '-DgroupId="com.mycompany" -DartifactId="s-demo-cicd" -Dversion="1.0.1" - 
       Dpackaging=jar -Dfile="demo-1.0.1-mule-application.jar" -DgeneratePom="true" - 
       DrepositoryId="$AZURE_FEED_ID" -Durl="$AZURE_FEED_URL"'

我在POM.xml文件中添加了所需的依賴項。

    <distributionManagement>
        <repository>
            <id>demo-mule</id>
            <url>https://pkgs.dev.azure.com/demo-mule/_packaging/demo-mule/maven/v1</url>
         <releases>
           <enabled>true</enabled>
         </releases>
         <snapshots>
           <enabled>true</enabled>
         </snapshots>
       </repository>
    </distributionManagement>

請幫助我了解我需要在哪里進行更改或更新。

要將變量傳遞給 Maven 任務的參數,請確保使用正確的表示法。 有時可能會有點混亂。

在這種情況下,使用$(...)而不是$... 所以你的任務看起來像這樣:

- task: Maven@3
  displayName: 'Maven Deploy'
  inputs:
   mavenPomFile: 'pom.xml'
   goals: 'deploy:deploy-file'
   options: '-DgroupId="com.mycompany" -DartifactId="s-demo-cicd" -Dversion="1.0.1" - 
       Dpackaging=jar -Dfile="demo-1.0.1-mule-application.jar" -DgeneratePom="true" - 
       DrepositoryId="$(AZURE_FEED_ID)" -Durl="$(AZURE_FEED_URL)"'

暫無
暫無

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

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