diff --git a/eng/pipelines/templates/stages/archetype-java-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-release-batch.yml index f1ba3d0068507..24a2d7c7e7235 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-batch.yml @@ -338,6 +338,9 @@ stages: - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' artifact: ${{parameters.ArtifactName}} + + - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -479,20 +482,8 @@ stages: - pwsh: | Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/ displayName: Show visible artifacts - # Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile. - # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html - - powershell: | - # Linux mvn `setting.xml` is sitting under path `~/.m2/setting.xml` - Get-Command mvn - if (!(Test-Path '~/.m2/')) { - mkdir ~/.m2/ - } - if (Test-Path '~/.m2/setting.xml') { - Write-Host "'setting.xml' exists. Overwriting the file to support multiple repositories." - } - Copy-Item "./eng/repo-docs/docms/daily.update.setting.xml" -Destination "~/.m2/settings.xml" - displayName: 'Configure mvn' - workingDirectory: $(Build.SourcesDirectory) + + - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: diff --git a/eng/pipelines/templates/stages/archetype-java-release-patch.yml b/eng/pipelines/templates/stages/archetype-java-release-patch.yml index 1fce6895798d4..50e817b937fda 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-patch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-patch.yml @@ -258,6 +258,9 @@ stages: - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' artifact: ${{parameters.ArtifactName}} + + - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 232438fba90d1..bcb7e5c37892d 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -276,6 +276,9 @@ stages: displayName: 'Download Artifact: ${{parameters.ArtifactName}}' artifact: ${{parameters.ArtifactName}} # Pull and build the docker image. + + - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -460,20 +463,8 @@ stages: - pwsh: | Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/ displayName: Show visible artifacts - # Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile. - # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html - - powershell: | - # Linux mvn `setting.xml` is sitting under path `~/.m2/setting.xml` - Get-Command mvn - if (!(Test-Path '~/.m2/')) { - mkdir ~/.m2/ - } - if (Test-Path '~/.m2/setting.xml') { - Write-Host "'setting.xml' exists. Overwriting the file to support multiple repositories." - } - Copy-Item "./eng/repo-docs/docms/daily.update.setting.xml" -Destination "~/.m2/settings.xml" - displayName: 'Configure mvn' - workingDirectory: $(Build.SourcesDirectory) + + - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: diff --git a/eng/pipelines/templates/steps/mvn-linux-repository-settings.yml b/eng/pipelines/templates/steps/mvn-linux-repository-settings.yml new file mode 100644 index 0000000000000..47ba091e37643 --- /dev/null +++ b/eng/pipelines/templates/steps/mvn-linux-repository-settings.yml @@ -0,0 +1,22 @@ +steps: + # /eng/repo-docs/docms/daily.update.setting.xml contains two settings + # 1. The java dev feed - This is for nightly builds and official builds, both of which publish + # to the dev feed. In the case of official builds, setting this up prevents us from having + # to deal with sonatype which may have a delay before what was just published is available. + # The dev feed does not have the same delay that sonatype does. + # 2. The docs-public-packages dev feed. This is where the docs java library, java2docfx is + # published. Nightly builds and official releases are published here and, while official releases + # are also published to sonatype, it's better to hit the public dev feed whenever possible. + # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html + - powershell: | + # Linux mvn `setting.xml` is sitting under path `~/.m2/setting.xml` + Get-Command mvn + if (!(Test-Path '~/.m2/')) { + mkdir ~/.m2/ + } + if (Test-Path '~/.m2/setting.xml') { + Write-Host "'setting.xml' exists. Overwriting the file to support multiple repositories." + } + Copy-Item "./eng/repo-docs/docms/daily.update.setting.xml" -Destination "~/.m2/settings.xml" + displayName: 'Configure mvn repo settings on linux' + workingDirectory: $(Build.SourcesDirectory) diff --git a/eng/scripts/docs/Docs-ToC.ps1 b/eng/scripts/docs/Docs-ToC.ps1 index cfb90e5f53cd8..1532293770756 100644 --- a/eng/scripts/docs/Docs-ToC.ps1 +++ b/eng/scripts/docs/Docs-ToC.ps1 @@ -138,7 +138,7 @@ function Get-Toc-Children($package, $docRepoLocation) { } } # Sort the array and clean out any dupes (there shouldn't be any but better safe than sorry) - $namespaces = $namespaces | Sort-Object -Unique + $namespaces = @($namespaces | Sort-Object -Unique) # Ensure that this always returns an array, even if there's one item or 0 items Write-Output -NoEnumerate $namespaces } @@ -221,7 +221,7 @@ function Fetch-Namespaces-From-Javadoc($package, $groupId, $version) { } } - $namespaces = $namespaces | Sort-Object -Unique + $namespaces = @($namespaces | Sort-Object -Unique) # Make sure this always returns an array Write-Output -NoEnumerate $namespaces } diff --git a/sdk/template/ci.yml b/sdk/template/ci.yml index 8f557e2e526f5..55e2d561f4caf 100644 --- a/sdk/template/ci.yml +++ b/sdk/template/ci.yml @@ -79,17 +79,17 @@ extends: groupId: com.azure safeName: azuresdktemplate releaseInBatch: ${{ parameters.release_azuresdktemplate }} - skipPublishDocMs: true + #skipPublishDocMs: true - name: azure-sdk-template-two groupId: com.azure safeName: azuresdktemplatetwo releaseInBatch: ${{ parameters.release_azuresdktemplatetwo }} - skipPublishDocMs: true + #skipPublishDocMs: true - name: azure-sdk-template-three groupId: com.azure safeName: azuresdktemplatethree releaseInBatch: ${{ parameters.release_azuresdktemplatethree }} - skipPublishDocMs: true + #skipPublishDocMs: true AdditionalModules: - name: azure-template-perf groupId: com.azure