Task in Azure DevOps Pipelines: Tasks internally get converted in low level os commands/api calls.
Azure DevOps has lot of predefined tasks Refer Here
We can also get additional tasks from Market Refer Here
Lets acheive building the code without using any task.
Manual command is mvn package
The pipeline is
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
name: Default
steps:
- bash: mvn package
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
name: Default
steps:
- task: Maven@3
inputs:
mavenPOMFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
testRunTitle: 'unittests'
Now push the changes and wait for pipeline getting executed