mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-27 03:21:29 +01:00
fixed JSON report to generate valid JSON
This commit is contained in:
@@ -37,8 +37,11 @@
|
|||||||
"sha1": "#if($related.Sha1sum)$enc.json($related.Sha1sum)#end",
|
"sha1": "#if($related.Sha1sum)$enc.json($related.Sha1sum)#end",
|
||||||
"md5": "#if($related.Md5sum)$enc.json($related.Md5sum)#end"#if($related.getIdentifiers()),
|
"md5": "#if($related.Md5sum)$enc.json($related.Md5sum)#end"#if($related.getIdentifiers()),
|
||||||
"identifiers": [
|
"identifiers": [
|
||||||
#foreach($id in $related.getIdentifiers())#if($foreach.count > 1),#end
|
#set($loopCount=0)
|
||||||
|
#foreach($id in $related.getIdentifiers())
|
||||||
#if ($id.type=="maven")
|
#if ($id.type=="maven")
|
||||||
|
#set($loopCount=$loopCount+1)
|
||||||
|
#if($loopCount>1),#end
|
||||||
{
|
{
|
||||||
"type": "$enc.json($id.type)",
|
"type": "$enc.json($id.type)",
|
||||||
"name": "$id.value"
|
"name": "$id.value"
|
||||||
@@ -47,6 +50,8 @@
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#if ($id.type=="npm")
|
#if ($id.type=="npm")
|
||||||
|
#set($loopCount=$loopCount+1)
|
||||||
|
#if($loopCount>1),#end
|
||||||
{
|
{
|
||||||
"id":"$enc.json($id.value)"
|
"id":"$enc.json($id.value)"
|
||||||
,"description":"$enc.json($id.description)"
|
,"description":"$enc.json($id.description)"
|
||||||
@@ -83,7 +88,8 @@
|
|||||||
],
|
],
|
||||||
"versionEvidence": [
|
"versionEvidence": [
|
||||||
#foreach($evidence in $dependency.getVersionEvidence())
|
#foreach($evidence in $dependency.getVersionEvidence())
|
||||||
#if($foreach.count > 1),#end{
|
#if($foreach.count > 1),#end
|
||||||
|
{
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"confidence": "$enc.json($evidence.getConfidence().toString())",
|
"confidence": "$enc.json($evidence.getConfidence().toString())",
|
||||||
"source": "$enc.json($evidence.getSource())",
|
"source": "$enc.json($evidence.getSource())",
|
||||||
@@ -95,25 +101,30 @@
|
|||||||
}
|
}
|
||||||
#if($dependency.getIdentifiers() && $dependency.getIdentifiers().size()>0)
|
#if($dependency.getIdentifiers() && $dependency.getIdentifiers().size()>0)
|
||||||
,"identifiers": [
|
,"identifiers": [
|
||||||
#foreach($id in $dependency.getIdentifiers())#if($foreach.count > 1),#end{
|
#foreach($id in $dependency.getIdentifiers())
|
||||||
|
#if($foreach.count > 1),#end
|
||||||
|
{
|
||||||
|
"count": "$loopCount",
|
||||||
"name": "$id.value",
|
"name": "$id.value",
|
||||||
"type": "$enc.json($id.type)",
|
"type": "$enc.json($id.type)"
|
||||||
#if($id.confidence)"confidence": "$id.confidence",#end
|
#if($id.confidence),"confidence": "$id.confidence"#end
|
||||||
#if($id.url)"url": "$enc.json($id.url)",#end
|
#if($id.url),"url": "$enc.json($id.url)"#end
|
||||||
#if($id.description )"description": "$enc.json($id.description)",#end
|
#if($id.description),"description": "$enc.json($id.description)"#end
|
||||||
#if ($id.notes)"notes": "$enc.json($id.notes)",#end
|
#if($id.notes),"notes": "$enc.json($id.notes)"#end
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
]#end
|
]#end
|
||||||
#if($dependency.getSuppressedIdentifiers() && $dependency.getSuppressedIdentifiers().size()>0)
|
#if($dependency.getSuppressedIdentifiers() && $dependency.getSuppressedIdentifiers().size()>0)
|
||||||
,"suppressedIdentifiers": [
|
,"suppressedIdentifiers": [
|
||||||
#foreach($id in $dependency.getSuppressedIdentifiers())#if($foreach.count > 1),#end{
|
#foreach($id in $dependency.getSuppressedIdentifiers())
|
||||||
|
#if($foreach.count > 1),#end
|
||||||
|
{
|
||||||
"name": "$id.value",
|
"name": "$id.value",
|
||||||
"type": "$enc.json($id.type)",
|
"type": "$enc.json($id.type)"
|
||||||
#if($id.confidence)"confidence": "$id.confidence",#end
|
#if($id.confidence),"confidence": "$id.confidence"#end
|
||||||
#if($id.url)"url": "$enc.json($id.url),"#end
|
#if($id.url),"url": "$enc.json($id.url)"#end
|
||||||
#if($id.description)"description": "$enc.json($id.description)",#end
|
#if($id.description),"description": "$enc.json($id.description)"#end
|
||||||
#if ($id.notes)"notes": "$enc.json($id.notes)"#end
|
#if($id.notes),"notes": "$enc.json($id.notes)"#end
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
]#end
|
]#end
|
||||||
|
|||||||
Reference in New Issue
Block a user