Problem
Each task node in a Flow pipeline runs in a fresh build environment that is discarded after the job. This causes slow builds because dependencies are downloaded on every run. To improve build efficiency, Flow provides a custom cache feature. You can define a cache directory to share files between pipeline runs, which significantly reduces the time spent re-downloading files.
This problem occurs when you use a custom settings.xml file from your organization that specifies a local repository. If this directory is not configured as a cache directory in the Flow pipeline, the pipeline re-downloads all build dependencies on every run.
Solutions
You can use one of the following two solutions:
-
Remove the <localRepository></localRepository> node from your organization's custom
settings.xmlfile to use the default cache directory. Ensure the Maven cache directory/root/.m2is added under pipeline orchestration -> variables and cache.ImportantEnsure the path to the cache directory is correct and that caching is enabled.
-
Add the directory specified in the <localRepository></localRepository> node of your organization's custom
settings.xmlfile to the cache directory settings under pipeline orchestration -> variables and cache. Ensure the path is correct and caching is enabled.