##[错误]在池代理中找不到满足指定要求的代理:maven,Agent.Version -gtVersion 2.163.1

Sat*_*dey 5 maven-3 maven azure-devops azure-pipelines azure-devops-pipelines

我正在尝试在 Azure DevOps 服务上构建和发布管道,就像我使用在 Azure 托管的 linuxVM 上运行的自托管 Linux 代理一样。

早些时候,相同的管道在 Microsoft 托管代理上运行时没有出现错误。

现在我正在##[error]No agent found in pool ProjectAgent which satisfies the specified demands: maven, Agent.Version -gtVersion 2.163.1

我已经在自托管Linux代理上安装了Java a和maven

:/home/-agent/_work/2/s/kubernetes # echo $JAVA_HOME
/usr/lib64/jvm/java
:/home/l-agent/_work/2/s/kubernetes # echo $M2_HOME
/opt/apache-maven-3.6.3
:/home/heisoul-agent/_work/2/s/kubernetes #
Run Code Online (Sandbox Code Playgroud)

即使在代理能力中也反映了

在此输入图像描述

管道Yml

# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/java

resources:
- repo: self

trigger:
  batch: true
  branches:
    include: 
    - main

pool:
  name: 'ProjectAgent'    
    
variables:
  tags: '$(Build.BuildNumber)'
  
- task: MavenAuthenticate@0
  displayName: 'Maven Authenticate'
  inputs:
    artifactsFeeds: myapp-snapshots,myapp-releases


- task: Maven@3
  displayName: 'Code Scan'
  inputs:
    mavenPomFile: '$(System.DefaultWorkingDirectory)/app-solution/core/build/maven/pom.xml'
    goals: package
    mavenAuthenticateFeed: true
    publishJUnitResults: true
    sonarQubeRunAnalysis: true
    sqMavenPluginVersionChoice: 'latest'
Run Code Online (Sandbox Code Playgroud)

管道失败

在此输入图像描述

Sha*_*zyk 8

功能中没有maven,可以手动添加:

在此输入图像描述

在此输入图像描述