I'm trying to build CI/CD for multiple java projects that are contained in one repo with Azure pipelines.
For this purpose was requirement to create one pipeline which will build every project with Maven@3 task. The problem is that when we add new project I want that only this one project was built and not every previous project. My file looks like :
resources:
- repo: self
clean: true
lfs: true
trigger:
branches:
include:
- feature/*
variables:
- group: vars
stages:
- stage: Build
pool:
vmImage: 'image'
jobs:
- job: Build
strategy:
maxParallel: 4
steps:
- task: replacetokens@3
inputs:
targetFiles: 'settings.xml'
- task: Maven@3
inputs:
jdkVersionOption: 1.8
mavenPomFile: 'project1/pom.xml'
options: '-s $(Build.SourcesDirectory)\settings.xml'
goals: 'clean package'
- task: Maven@3
inputs:
jdkVersionOption: 1.8
mavenPomFile: 'project2/pom.xml'
options: '-s $(Build.SourcesDirectory)\settings.xml'
goals: 'clean package'
For example project1 is alraedy in develop, so I don't want to do mvn package for it, but only for project2, which is this not merged and has feature branch.
For now this yml won't work because project1 and project2 are in the same repo and this two task will run, which I wan t to avoid.
Is there some way to say "onChange" ???