From a1e0674048d6de8f9f3a629c64f52ea3517a4c1d Mon Sep 17 00:00:00 2001 From: Winnie Date: Wed, 29 Apr 2020 14:16:58 +0200 Subject: [PATCH] Mention that Maven task overwrites MAVEN_OPTS --- docs/pipelines/release/caching.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/pipelines/release/caching.md b/docs/pipelines/release/caching.md index fbd499b86ac..b8f3295ca13 100644 --- a/docs/pipelines/release/caching.md +++ b/docs/pipelines/release/caching.md @@ -283,6 +283,15 @@ steps: - script: mvn install -B -e ``` +If you are using a [Maven task](../tasks/build/maven.md), make sure to also pass the `MAVEN_OPTS` variable because it gets overwritten otherwise: + +```yaml +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m $(MAVEN_OPTS)' +``` + ## .NET/NuGet If you use `PackageReferences` to manage NuGet dependencies directly within your project file and have `packages.lock.json` file(s), you can enable caching by setting the `NUGET_PACKAGES` environment variable to a path under `$(Pipeline.Workspace)` and caching this directory.