mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 08:13:43 +01:00
removed un-needed code from invoker build scripts
This commit is contained in:
@@ -16,13 +16,4 @@
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
// Save NVD-CVE for next IT (if not already done)
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
if (datasDwl.exists() && !datasSave.exists()){
|
||||
System.out.println("Save NVD-CVE into backup");
|
||||
FileUtils.copyFile(datasDwl, datasSave);
|
||||
}
|
||||
return true;
|
||||
@@ -15,14 +15,3 @@
|
||||
*
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
// Load NVD-CVE if not exist and had been saved in a previous IT
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
|
||||
if (!datasDwl.exists() && datasSave.exists()){
|
||||
System.out.println("Load NVD-CVE from backup");
|
||||
FileUtils.copyFile(datasSave, datasDwl);
|
||||
}
|
||||
|
||||
@@ -27,3 +27,4 @@ if (!StringUtils.contains(log, "Database file purged; local copy of the NVD has
|
||||
System.out.println("The database was not purged.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -20,19 +20,11 @@ import java.nio.charset.Charset;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
// Save NVD-CVE for next IT (if not already done)
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
if (datasDwl.exists() && !datasSave.exists()){
|
||||
System.out.println("Save NVD-CVE into backup");
|
||||
FileUtils.copyFile(datasDwl, datasSave);
|
||||
}
|
||||
|
||||
// Analyse number of "Checking for updates"
|
||||
String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name());
|
||||
int count = StringUtils.countMatches(log, "Checking for updates");
|
||||
if (count > 1){
|
||||
System.out.println(String.format("The update should be unique, it is %s", count));
|
||||
return false;
|
||||
//throw new Exception(String.format("The update should be unique, it is %s", count));
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -16,13 +16,3 @@
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
// Load NVD-CVE if not exist and had been saved in a previous IT
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
|
||||
if (!datasDwl.exists() && datasSave.exists()){
|
||||
System.out.println("Load NVD-CVE from backup");
|
||||
FileUtils.copyFile(datasSave, datasDwl);
|
||||
}
|
||||
|
||||
@@ -19,16 +19,6 @@
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
// Save NVD-CVE for next IT (if not already done)
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
if (datasDwl.exists() && !datasSave.exists()){
|
||||
System.out.println("Save NVD-CVE into backup");
|
||||
FileUtils.copyFile(datasDwl, datasSave);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Check to see if jackson-dataformat-xml-2.4.5.jar was identified.
|
||||
@@ -36,7 +26,7 @@ if (datasDwl.exists() && !datasSave.exists()){
|
||||
String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name());
|
||||
int count = StringUtils.countMatches(log, "<fileName>jackson-dataformat-xml-2.4.5.jar</fileName>");
|
||||
if (count == 0){
|
||||
System.out.println(String.format("The update should be unique, it is %s", count));
|
||||
System.out.println(String.format("jackson-dataformat-xml was identified %s times, expected 1", count));
|
||||
return false;
|
||||
//throw new Exception(String.format("The update should be unique, it is %s", count));
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -15,14 +15,3 @@
|
||||
*
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
// Load NVD-CVE if not exist and had been saved in a previous IT
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
|
||||
if (!datasDwl.exists() && datasSave.exists()){
|
||||
System.out.println("Load NVD-CVE from backup");
|
||||
FileUtils.copyFile(datasSave, datasDwl);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,14 @@
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
// Save NVD-CVE for next IT (if not already done)
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
if (datasDwl.exists() && !datasSave.exists()){
|
||||
System.out.println("Save NVD-CVE into backup");
|
||||
FileUtils.copyFile(datasDwl, datasSave);
|
||||
String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name());
|
||||
int count = StringUtils.countMatches(log, "Download Started for NVD CVE - 2002");
|
||||
if (count > 1){
|
||||
System.out.println(String.format("NVD CVE was downloaded %s times, should be 0 or 1 times", count));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -15,14 +15,3 @@
|
||||
*
|
||||
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||
*/
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
// Load NVD-CVE if not exist and had been saved in a previous IT
|
||||
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||
|
||||
if (!datasDwl.exists() && datasSave.exists()){
|
||||
System.out.println("Load NVD-CVE from backup");
|
||||
FileUtils.copyFile(datasSave, datasDwl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user