Skip to content

Commit 4a13009

Browse files
jt-ntimbwhite
authored andcommitted
Add OWASP dependency checks to build
Signed-off-by: James Taylor <[email protected]>
1 parent 44c96d7 commit 4a13009

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

ci/azure-pipelines.yml

+19
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ stages:
6666
publishJUnitResults: true
6767
testResultsFiles: "$(System.DefaultWorkingDirectory)/**/TEST-*.xml"
6868
tasks: "build"
69+
- task: PublishTestResults@2
70+
inputs:
71+
testResultsFormat: 'JUnit'
72+
testResultsFiles: 'fabric-chaincode-shim/build/reports/dependency-check-junit.xml'
73+
mergeTestResults: true
74+
failTaskOnFailedTests: false
75+
testRunTitle: OWASP Dependency Check
76+
displayName: 'Publish OWASP Dependency Check JUnit results'
77+
- task: CopyFiles@2
78+
inputs:
79+
contents: |
80+
fabric-chaincode-shim/build/reports/dependency-check-*.*
81+
targetFolder: $(Build.ArtifactStagingDirectory)/dependency-check
82+
displayName: 'Collect OWASP Dependency Check results'
83+
- task: PublishBuildArtifacts@1
84+
inputs:
85+
pathToPublish: $(Build.ArtifactStagingDirectory)/dependency-check
86+
artifactName: 'Dependency Check Report'
87+
displayName: 'Publish full OWASP Dependency Check result'
6988
- task: PublishCodeCoverageResults@1
7089
inputs:
7190
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/fabric-chaincode-shim/build/reports/jacoco/test/jacocoTestReport.xml"

fabric-chaincode-protos/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ buildscript {
4545
}
4646

4747
dependencies {
48-
compile 'com.google.protobuf:protobuf-java:3.9.1'
49-
compile 'com.google.protobuf:protobuf-java-util:3.9.1'
50-
compile 'io.grpc:grpc-netty:1.23.0'
51-
compile 'io.grpc:grpc-protobuf:1.23.0'
52-
compile 'io.grpc:grpc-stub:1.23.0'
48+
compile 'com.google.protobuf:protobuf-java:3.11.1'
49+
compile 'com.google.protobuf:protobuf-java-util:3.11.1'
50+
compile 'io.grpc:grpc-netty:1.25.0'
51+
compile 'io.grpc:grpc-protobuf:1.25.0'
52+
compile 'io.grpc:grpc-stub:1.25.0'
5353
// Required if using Java 11+ as no longer bundled in the core libraries
5454
compile 'javax.annotation:javax.annotation-api:1.3.2'
5555
}

fabric-chaincode-shim/build.gradle

+16-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
buildscript {
7+
repositories {
8+
mavenCentral()
9+
}
10+
dependencies {
11+
classpath 'org.owasp:dependency-check-gradle:5.2.1'
12+
}
13+
}
614

715
plugins {
816
id 'maven-publish'
@@ -11,11 +19,14 @@ plugins {
1119
id 'signing'
1220
}
1321

22+
apply plugin: 'org.owasp.dependencycheck'
23+
24+
check.dependsOn dependencyCheckAnalyze
25+
1426
tasks.withType(org.gradle.api.tasks.testing.Test) {
1527
systemProperty 'CORE_CHAINCODE_LOGGING_LEVEL', 'DEBUG'
1628
}
1729

18-
1930
dependencies {
2031
compile project(':fabric-chaincode-protos')
2132
compile 'org.bouncycastle:bcpkix-jdk15on:1.62'
@@ -27,13 +38,15 @@ dependencies {
2738
testCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
2839
}
2940

41+
dependencyCheck {
42+
format='ALL'
43+
}
44+
3045
sourceSets {
3146
main {
3247
java {
3348
srcDirs 'src/main/java'
3449
}
35-
36-
3750
}
3851

3952
test {

0 commit comments

Comments
 (0)