-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
40 lines (32 loc) · 915 Bytes
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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
trigger:
- main
pr:
- main
pool:
vmImage: ubuntu-latest
variables:
JDK_VERSION: 1.21
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTIONS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Xmx3072m'
MAVEN_COMMAND_LINE_ARGUMENTS: '--batch-mode'
steps:
- checkout: self
clean: 'true'
- task: Cache@2
displayName: Cache Maven local repo
inputs:
key: 'maven | "$(Agent.OS)" | **/pom.xml'
restoreKeys: |
maven | "$(Agent.OS)"
maven
path: $(MAVEN_CACHE_FOLDER)
- task: Maven@3
displayName: Build and test
inputs:
jdkVersionOption: ${{ variables.JDK_VERSION }}
mavenOptions: $(MAVEN_OPTIONS)
goals: '$(MAVEN_COMMAND_LINE_ARGUMENTS) verify'