0
votes

I am trying to have build and release pipeline on Azure DevOps services for the same I am using self hosted Linux agent runnig on linuxVM hosted in Azure.

Earlier the same pipeline was running on Microsoft hosted Agent there was no error.

Right now I am getting ##[error]No agent found in pool ProjectAgent which satisfies the specified demands: maven, Agent.Version -gtVersion 2.163.1

I have installed Java aand maven on selfhosted Linux Agent

:/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 #

Even in the Agent Capability its reflecting

enter image description here

Pipeline Yaml

# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.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'

Pipeline failed

enter image description here

1

1 Answers

0
votes

There is no maven in the capabilities, you can add it manually:

enter image description here

enter image description here