removed un-needed code from invoker build scripts

This commit is contained in:
Jeremy Long
2017-04-26 07:30:33 -04:00
parent 6813427867
commit 3786f6ebc7
9 changed files with 12 additions and 80 deletions

View File

@@ -16,13 +16,4 @@
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * Copyright (c) 2014 Jeremy Long. All Rights Reserved.
*/ */
import org.apache.commons.io.FileUtils; return true;
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);
}

View File

@@ -15,14 +15,3 @@
* *
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * 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);
}

View File

@@ -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."); System.out.println("The database was not purged.");
return false; return false;
} }
return true;

View File

@@ -20,19 +20,11 @@ import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; 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" // Analyse number of "Checking for updates"
String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name()); String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name());
int count = StringUtils.countMatches(log, "Checking for updates"); int count = StringUtils.countMatches(log, "Checking for updates");
if (count > 1){ if (count > 1){
System.out.println(String.format("The update should be unique, it is %s", count)); System.out.println(String.format("The update should be unique, it is %s", count));
return false; return false;
//throw new Exception(String.format("The update should be unique, it is %s", count));
} }
return true;

View File

@@ -16,13 +16,3 @@
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * 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);
}

View File

@@ -20,23 +20,13 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.nio.charset.Charset; 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. // Check to see if jackson-dataformat-xml-2.4.5.jar was identified.
//TODO change this to xpath and check for CVE-2016-3720 //TODO change this to xpath and check for CVE-2016-3720
String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name()); 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>"); int count = StringUtils.countMatches(log, "<fileName>jackson-dataformat-xml-2.4.5.jar</fileName>");
if (count == 0){ 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; return false;
//throw new Exception(String.format("The update should be unique, it is %s", count));
} }
return true;

View File

@@ -15,14 +15,3 @@
* *
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * 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);
}

View File

@@ -16,13 +16,14 @@
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * Copyright (c) 2014 Jeremy Long. All Rights Reserved.
*/ */
import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
// Save NVD-CVE for next IT (if not already done) String log = FileUtils.readFileToString(new File(basedir, "build.log"), Charset.defaultCharset().name());
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db"); int count = StringUtils.countMatches(log, "Download Started for NVD CVE - 2002");
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db"); if (count > 1){
if (datasDwl.exists() && !datasSave.exists()){ System.out.println(String.format("NVD CVE was downloaded %s times, should be 0 or 1 times", count));
System.out.println("Save NVD-CVE into backup"); return false;
FileUtils.copyFile(datasDwl, datasSave);
} }
return true;

View File

@@ -15,14 +15,3 @@
* *
* Copyright (c) 2014 Jeremy Long. All Rights Reserved. * 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);
}