Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions eng/pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,50 @@ jobs:
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest'))
displayName: 'Component Detection'

# We `install` separately from running `site:site site:stage` so that the `install` brings in the non-shipping-modules,
# but we don't include them in the Maven site commands (so that we don't generate reports for the non-shipping modules).
# We `install` the code quality reports tooling into our local m2 cache separately from building the Maven project
# reports. This means it is available as part of that, but also so that this is not documented in the project report.
- task: Maven@3
displayName: 'Install reporting tools'
inputs:
mavenPomFile: eng/code-quality-reports/pom.xml
options: '--batch-mode'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

- task: Maven@3
displayName: 'Install all client libraries (for SpotBugs analysis)'
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -Dinclude-non-shipping-modules -DskipTests -Dgpg.skip'
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

# Run SpotBugs and CheckStyle tools to ensure high code quality - these will fail the build if issues are found
- task: Maven@3
displayName: 'Run SpotBugs and CheckStyle'
inputs:
mavenPomFile: pom.client.xml
options: '-Djava-lts -DskipTests -Dgpg.skip'
mavenOptions: ''
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'spotbugs:spotbugs checkstyle:checkstyle'

# Generate the Maven site report, including SpotBugs, JavaDoc, CheckStyle, Jacoco, etc only when we are not
# running as a PR check.
- task: Maven@3
displayName: 'Generate Maven project site, including JavaDocs, SpotBugs, and CheckStyle reports'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip'
Expand All @@ -96,7 +124,22 @@ jobs:
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'site:site site:stage'
goals: 'install site:site site:stage'

# We run a separate SpotBugs aggregate report step here to roll-up all the issues identified per-module in the
# previous step. This is only generated in non-PR builds (i.e. nightly runs, etc)
- task: Maven@3
displayName: 'Run SpotBugs'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
mavenPomFile: eng/spotbugs-aggregate-report/pom.xml
options: '--batch-mode -Djava-lts -DskipTests -Dgpg.skip'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

- script: |
git clone https://github.com/JonathanGiles/DependencyChecker.git
Expand Down Expand Up @@ -127,12 +170,14 @@ jobs:
publishJUnitResults: false
goals: 'clean package exec:java'

# We only copy artifacts into the staging in nightly builds, we don't bother with this for PR validation builds.
- powershell: |
copy -r target/staging $(Build.ArtifactStagingDirectory)
copy eng/code-quality-reports/src/main/resources/index.html $(Build.ArtifactStagingDirectory)
copy eng/spotbugs-aggregate-report/target/spotbugs/spotbugsXml.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
copy output/dependencies.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
displayName: 'Copy reports to artifact staging'
condition: ne(variables['Build.Reason'], 'PullRequest')

- task: PublishPipelineArtifact@0
condition: succeededOrFailed()
Expand Down
54 changes: 50 additions & 4 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,50 @@ jobs:
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest'))
displayName: 'Component Detection'

# We `install` separately from running `site:site site:stage` so that the `install` brings in the non-shipping-modules,
# but we don't include them in the Maven site commands (so that we don't generate reports for the non-shipping modules).
# We `install` the code quality reports tooling into our local m2 cache separately from building the Maven project
# reports. This means it is available as part of that, but also so that this is not documented in the project report.
- task: Maven@3
displayName: 'Install reporting tools'
inputs:
mavenPomFile: eng/code-quality-reports/pom.xml
options: '--batch-mode'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

- task: Maven@3
displayName: 'Install all client libraries (for SpotBugs analysis)'
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -Dinclude-non-shipping-modules -DskipTests -Dgpg.skip'
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

# Run SpotBugs and CheckStyle tools to ensure high code quality - these will fail the build if issues are found
- task: Maven@3
displayName: 'Run SpotBugs and CheckStyle'
inputs:
mavenPomFile: pom.client.xml
options: '-Djava-lts -DskipTests -Dgpg.skip'
mavenOptions: ''
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'spotbugs:spotbugs checkstyle:checkstyle'

# Generate the Maven site report, including SpotBugs, JavaDoc, CheckStyle, Jacoco, etc only when we are not
# running as a PR check.
- task: Maven@3
displayName: 'Generate Maven project site, including JavaDocs, SpotBugs, and CheckStyle reports'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip'
Expand All @@ -91,7 +119,22 @@ jobs:
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'site:site site:stage'
goals: 'install site:site site:stage'

# We run a separate SpotBugs aggregate report step here to roll-up all the issues identified per-module in the
# previous step. This is only generated in non-PR builds (i.e. nightly runs, etc)
- task: Maven@3
displayName: 'Run SpotBugs'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
mavenPomFile: eng/spotbugs-aggregate-report/pom.xml
options: '--batch-mode -Djava-lts -DskipTests -Dgpg.skip'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'install'

- script: |
git clone https://github.com/JonathanGiles/DependencyChecker.git
Expand Down Expand Up @@ -122,19 +165,22 @@ jobs:
publishJUnitResults: false
goals: 'clean package exec:java'

# We only copy artifacts into the staging in nightly builds, we don't bother with this for PR validation builds.
- powershell: |
copy -r target/staging $(Build.ArtifactStagingDirectory)
copy eng/code-quality-reports/src/main/resources/index.html $(Build.ArtifactStagingDirectory)
copy eng/spotbugs-aggregate-report/target/spotbugs/spotbugsXml.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
copy output/dependencies.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
displayName: 'Copy reports to artifact staging'
condition: ne(variables['Build.Reason'], 'PullRequest')

- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
displayName: 'Publish Report Artifacts'
inputs:
artifactName: reports


- job: 'Test'

variables:
Expand Down
40 changes: 8 additions & 32 deletions pom.client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -454,20 +454,6 @@

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down Expand Up @@ -504,21 +490,14 @@
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.maven.version}</version>
<reportSets>
<reportSet>
<id>non-aggregate</id>
<reports>
<report>spotbugs</report>
</reports>
</reportSet>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>spotbugs</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
<excludeFilterFile>eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml</excludeFilterFile>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -573,9 +552,6 @@
<report>ci-management</report>
<report>dependencies</report>
<report>issue-management</report>
<report>licenses</report>
<report>plugins</report>
<report>plugin-management</report>
</reports>
</reportSet>
</reportSets>
Expand Down