Issue
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
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
Solution
There is no maven
in the capabilities, you can add it manually:
Answered By - Shayki Abramczyk
Answer Checked By - Senaida (JavaFixing Volunteer)