|
| 1 | +# Variables that route Maven through the Central Feed Service (CFS), as required by |
| 2 | +# SFI Network Isolation. Consumed by every pipeline in this directory that builds the |
| 3 | +# Java side of the extension: |
| 4 | +# |
| 5 | +# variables: |
| 6 | +# - template: /.azure-pipelines/maven-cfs-variables.yml@self |
| 7 | +# |
| 8 | +# There is deliberately no companion steps template. Everything the redirect needs is |
| 9 | +# already understood by Maven and its wrapper as environment variables, so no task has |
| 10 | +# to rewrite a settings file and nothing in the checked-out tree is modified. Pipeline |
| 11 | +# variables are exported to every step in the job, which is what makes this work for |
| 12 | +# the Maven runs these builds start indirectly -- from an npm script or a gulp task -- |
| 13 | +# and never name on a command line of their own. |
| 14 | +# |
| 15 | +# Two independent egress paths have to be closed, and only the first is obvious. |
| 16 | +variables: |
| 17 | + # The feed's maven/v1 endpoint, read by cfs-settings.xml and by the wrapper below. |
| 18 | + # Committing it matches npm-cfs-variables.yml: a feed address is not a secret, and |
| 19 | + # the token that makes it usable never leaves the agent. |
| 20 | + - name: CFS_MAVEN_URL |
| 21 | + value: https://pkgs.dev.azure.com/mseng/VSJava/_packaging/vscjava/maven/v1 |
| 22 | + |
| 23 | + # Path one: artifact resolution. The `mvn` launcher prepends MAVEN_ARGS to every |
| 24 | + # invocation, so build scripts keep calling `mvnw` with no extra flags of their own. |
| 25 | + # Supported by Maven 3.9 and newer, which is what the wrapper here pins. |
| 26 | + - name: MAVEN_ARGS |
| 27 | + value: -s $(Build.SourcesDirectory)/.azure-pipelines/cfs-settings.xml |
| 28 | + # System.AccessToken is not an environment variable on the agent unless it is mapped |
| 29 | + # like this. cfs-settings.xml reads it as the mirror's password. |
| 30 | + - name: SYSTEM_ACCESSTOKEN |
| 31 | + value: $(System.AccessToken) |
| 32 | + |
| 33 | + # Path two: the Maven distribution itself. The wrapper downloads it from |
| 34 | + # distributionUrl before Maven exists, so settings.xml cannot influence that request. |
| 35 | + # MVNW_REPOURL substitutes everything ahead of /org/apache/maven/ in that URL, which |
| 36 | + # is why .mvn/wrapper/maven-wrapper.properties still names the public host and needs |
| 37 | + # no edit: contributors keep a wrapper that works, agents resolve it from the feed. |
| 38 | + - name: MVNW_REPOURL |
| 39 | + value: $(CFS_MAVEN_URL) |
| 40 | + - name: MVNW_USERNAME |
| 41 | + value: AzureDevOps |
| 42 | + - name: MVNW_PASSWORD |
| 43 | + value: $(System.AccessToken) |
0 commit comments