From b61b9a6b316b6940f65b162274eedc18182b6826 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Wed, 30 Apr 2014 18:27:49 -0400 Subject: [PATCH] v1.2.0.1 --- .../apidocs/allclasses-frame.html | 6 +- .../apidocs/allclasses-noframe.html | 6 +- .../apidocs/constant-values.html | 8 +- .../apidocs/deprecated-list.html | 8 +- dependency-check-cli/apidocs/help-doc.html | 8 +- dependency-check-cli/apidocs/index-all.html | 8 +- dependency-check-cli/apidocs/index.html | 4 +- .../org/owasp/dependencycheck/App.html | 8 +- .../owasp/dependencycheck/class-use/App.html | 8 +- .../cli/CliParser.ArgumentName.html | 8 +- .../owasp/dependencycheck/cli/CliParser.html | 8 +- .../cli/class-use/CliParser.ArgumentName.html | 8 +- .../cli/class-use/CliParser.html | 8 +- .../dependencycheck/cli/package-frame.html | 6 +- .../dependencycheck/cli/package-summary.html | 8 +- .../dependencycheck/cli/package-tree.html | 8 +- .../dependencycheck/cli/package-use.html | 8 +- .../owasp/dependencycheck/package-frame.html | 6 +- .../dependencycheck/package-summary.html | 8 +- .../owasp/dependencycheck/package-tree.html | 8 +- .../owasp/dependencycheck/package-use.html | 8 +- .../apidocs/overview-frame.html | 6 +- .../apidocs/overview-summary.html | 10 +- .../apidocs/overview-tree.html | 8 +- dependency-check-cli/arguments.html | 10 +- dependency-check-cli/checkstyle.html | 10 +- ...summary-org.owasp.dependencycheck.cli.html | 2 +- ...ame-summary-org.owasp.dependencycheck.html | 6 +- .../cobertura/frame-summary.html | 6 +- .../org.owasp.dependencycheck.App.html | 497 +++++++++--------- ...g.owasp.dependencycheck.cli.CliParser.html | 2 +- .../dependency-updates-report.html | 10 +- dependency-check-cli/findbugs.html | 10 +- dependency-check-cli/index.html | 10 +- dependency-check-cli/installation.html | 12 +- dependency-check-cli/license.html | 215 +++++++- .../plugin-updates-report.html | 10 +- dependency-check-cli/pmd.html | 10 +- dependency-check-cli/project-info.html | 10 +- dependency-check-cli/project-reports.html | 10 +- dependency-check-cli/project-summary.html | 12 +- dependency-check-cli/surefire-report.html | 28 +- dependency-check-cli/taglist.html | 14 +- dependency-check-cli/xref-test/index.html | 2 +- .../dependencycheck/cli/package-frame.html | 2 +- .../dependencycheck/cli/package-summary.html | 2 +- .../xref-test/overview-frame.html | 2 +- .../xref-test/overview-summary.html | 4 +- dependency-check-cli/xref/index.html | 2 +- .../xref/org/owasp/dependencycheck/App.html | 414 +++++++-------- .../dependencycheck/cli/package-frame.html | 2 +- .../dependencycheck/cli/package-summary.html | 2 +- .../owasp/dependencycheck/package-frame.html | 2 +- .../dependencycheck/package-summary.html | 2 +- dependency-check-cli/xref/overview-frame.html | 2 +- .../xref/overview-summary.html | 4 +- 56 files changed, 857 insertions(+), 649 deletions(-) diff --git a/dependency-check-cli/apidocs/allclasses-frame.html b/dependency-check-cli/apidocs/allclasses-frame.html index ee5ce0c9a..710aa0598 100644 --- a/dependency-check-cli/apidocs/allclasses-frame.html +++ b/dependency-check-cli/apidocs/allclasses-frame.html @@ -2,10 +2,10 @@ - + -All Classes (Dependency-Check Command Line 1.2.0 API) - +All Classes (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/allclasses-noframe.html b/dependency-check-cli/apidocs/allclasses-noframe.html index 57d0df867..45a806bd5 100644 --- a/dependency-check-cli/apidocs/allclasses-noframe.html +++ b/dependency-check-cli/apidocs/allclasses-noframe.html @@ -2,10 +2,10 @@ - + -All Classes (Dependency-Check Command Line 1.2.0 API) - +All Classes (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/constant-values.html b/dependency-check-cli/apidocs/constant-values.html index 82c8c01b2..4047cd54b 100644 --- a/dependency-check-cli/apidocs/constant-values.html +++ b/dependency-check-cli/apidocs/constant-values.html @@ -2,16 +2,16 @@ - + -Constant Field Values (Dependency-Check Command Line 1.2.0 API) - +Constant Field Values (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/deprecated-list.html b/dependency-check-cli/apidocs/deprecated-list.html index 931ece1e2..273f89c7d 100644 --- a/dependency-check-cli/apidocs/deprecated-list.html +++ b/dependency-check-cli/apidocs/deprecated-list.html @@ -2,16 +2,16 @@ - + -Deprecated List (Dependency-Check Command Line 1.2.0 API) - +Deprecated List (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/help-doc.html b/dependency-check-cli/apidocs/help-doc.html index d3d50d3a9..502da3f67 100644 --- a/dependency-check-cli/apidocs/help-doc.html +++ b/dependency-check-cli/apidocs/help-doc.html @@ -2,16 +2,16 @@ - + -API Help (Dependency-Check Command Line 1.2.0 API) - +API Help (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/index-all.html b/dependency-check-cli/apidocs/index-all.html index 07389cd34..6efc09b7e 100644 --- a/dependency-check-cli/apidocs/index-all.html +++ b/dependency-check-cli/apidocs/index-all.html @@ -2,16 +2,16 @@ - + -Index (Dependency-Check Command Line 1.2.0 API) - +Index (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/index.html b/dependency-check-cli/apidocs/index.html index 4359686f2..ad6a32ae9 100644 --- a/dependency-check-cli/apidocs/index.html +++ b/dependency-check-cli/apidocs/index.html @@ -2,9 +2,9 @@ - + -Dependency-Check Command Line 1.2.0 API +Dependency-Check Command Line 1.2.0.1 API diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/class-use/App.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/class-use/App.html index 3ea131be6..2dd88053f 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/class-use/App.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/class-use/App.html @@ -2,16 +2,16 @@ - + -Uses of Class org.owasp.dependencycheck.App (Dependency-Check Command Line 1.2.0 API) - +Uses of Class org.owasp.dependencycheck.App (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.ArgumentName.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.ArgumentName.html index 325ed607a..873a0f8c2 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.ArgumentName.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.ArgumentName.html @@ -2,16 +2,16 @@ - + -CliParser.ArgumentName (Dependency-Check Command Line 1.2.0 API) - +CliParser.ArgumentName (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.html index c4d76071e..67d7a4d99 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/CliParser.html @@ -2,16 +2,16 @@ - + -CliParser (Dependency-Check Command Line 1.2.0 API) - +CliParser (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.ArgumentName.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.ArgumentName.html index 68eb88420..dc84a39fd 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.ArgumentName.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.ArgumentName.html @@ -2,16 +2,16 @@ - + -Uses of Class org.owasp.dependencycheck.cli.CliParser.ArgumentName (Dependency-Check Command Line 1.2.0 API) - +Uses of Class org.owasp.dependencycheck.cli.CliParser.ArgumentName (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.html index 7bd9650db..965e006a9 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/class-use/CliParser.html @@ -2,16 +2,16 @@ - + -Uses of Class org.owasp.dependencycheck.cli.CliParser (Dependency-Check Command Line 1.2.0 API) - +Uses of Class org.owasp.dependencycheck.cli.CliParser (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-frame.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-frame.html index a1f91a19f..f2537058d 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-frame.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-frame.html @@ -2,10 +2,10 @@ - + -org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-summary.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-summary.html index 3a2805de8..de8f83aef 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-summary.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-summary.html @@ -2,16 +2,16 @@ - + -org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-tree.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-tree.html index 7d2cd9e0c..3b3fb2a79 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-tree.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-tree.html @@ -2,16 +2,16 @@ - + -org.owasp.dependencycheck.cli Class Hierarchy (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck.cli Class Hierarchy (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-use.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-use.html index a782f8ea9..4f919ad10 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-use.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/cli/package-use.html @@ -2,16 +2,16 @@ - + -Uses of Package org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0 API) - +Uses of Package org.owasp.dependencycheck.cli (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-frame.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-frame.html index dc4acc942..726ed396d 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-frame.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-frame.html @@ -2,10 +2,10 @@ - + -org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-summary.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-summary.html index 22c8a03f7..11fd7fd12 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-summary.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-summary.html @@ -2,16 +2,16 @@ - + -org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-tree.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-tree.html index fc8995399..62bb1ba09 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-tree.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-tree.html @@ -2,16 +2,16 @@ - + -org.owasp.dependencycheck Class Hierarchy (Dependency-Check Command Line 1.2.0 API) - +org.owasp.dependencycheck Class Hierarchy (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-use.html b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-use.html index a195896ab..2921624f2 100644 --- a/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-use.html +++ b/dependency-check-cli/apidocs/org/owasp/dependencycheck/package-use.html @@ -2,16 +2,16 @@ - + -Uses of Package org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0 API) - +Uses of Package org.owasp.dependencycheck (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/overview-frame.html b/dependency-check-cli/apidocs/overview-frame.html index 41ed0f333..be40f41b3 100644 --- a/dependency-check-cli/apidocs/overview-frame.html +++ b/dependency-check-cli/apidocs/overview-frame.html @@ -2,10 +2,10 @@ - + -Overview List (Dependency-Check Command Line 1.2.0 API) - +Overview List (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/apidocs/overview-summary.html b/dependency-check-cli/apidocs/overview-summary.html index 1378a81a5..b8cae1aad 100644 --- a/dependency-check-cli/apidocs/overview-summary.html +++ b/dependency-check-cli/apidocs/overview-summary.html @@ -2,16 +2,16 @@ - + -Overview (Dependency-Check Command Line 1.2.0 API) - +Overview (Dependency-Check Command Line 1.2.0.1 API) + @@ -64,7 +64,7 @@
-

Dependency-Check Command Line 1.2.0 API

+

Dependency-Check Command Line 1.2.0.1 API

diff --git a/dependency-check-cli/apidocs/overview-tree.html b/dependency-check-cli/apidocs/overview-tree.html index 10d0a0b5e..4c9b6f370 100644 --- a/dependency-check-cli/apidocs/overview-tree.html +++ b/dependency-check-cli/apidocs/overview-tree.html @@ -2,16 +2,16 @@ - + -Class Hierarchy (Dependency-Check Command Line 1.2.0 API) - +Class Hierarchy (Dependency-Check Command Line 1.2.0.1 API) + diff --git a/dependency-check-cli/arguments.html b/dependency-check-cli/arguments.html index 53cf9ddcb..a2d92f626 100644 --- a/dependency-check-cli/arguments.html +++ b/dependency-check-cli/arguments.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Command Line Arguments @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/checkstyle.html b/dependency-check-cli/checkstyle.html index 7d01089b1..02071a2ee 100644 --- a/dependency-check-cli/checkstyle.html +++ b/dependency-check-cli/checkstyle.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Checkstyle Results @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.cli.html b/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.cli.html index 2929c7d91..ab9289540 100644 --- a/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.cli.html +++ b/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.cli.html @@ -38,6 +38,6 @@ var classTable = new SortableTable(document.getElementById("classResults"), ["String", "Percentage", "Percentage", "FormattedNumber"]); classTable.sort(0); - + diff --git a/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.html b/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.html index 9a93c65b8..cfb27c971 100644 --- a/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.html +++ b/dependency-check-cli/cobertura/frame-summary-org.owasp.dependencycheck.html @@ -16,7 +16,7 @@
    - +
    Package # Classes Line Coverage Branch Coverage Complexity
    org.owasp.dependencycheck1
    0%
    0/137
    0%
    0/90
    12.5
    org.owasp.dependencycheck1
    0%
    0/138
    0%
    0/90
    12.5
    org.owasp.dependencycheck.cli2
    65%
    81/124
    39%
    27/68
    1.829
    @@ -29,7 +29,7 @@ packageTable.sort(0); - +
    Classes in this Package Line Coverage Branch Coverage Complexity
    App
    0%
    0/137
    0%
    0/90
    12.5
    App
    0%
    0/138
    0%
    0/90
    12.5
    @@ -38,6 +38,6 @@ var classTable = new SortableTable(document.getElementById("classResults"), ["String", "Percentage", "Percentage", "FormattedNumber"]); classTable.sort(0); - + diff --git a/dependency-check-cli/cobertura/frame-summary.html b/dependency-check-cli/cobertura/frame-summary.html index 9cf8b8c7b..79e7e52b6 100644 --- a/dependency-check-cli/cobertura/frame-summary.html +++ b/dependency-check-cli/cobertura/frame-summary.html @@ -16,8 +16,8 @@ - - + +
    Package # Classes Line Coverage Branch Coverage Complexity
    All Packages3
    31%
    81/261
    17%
    27/158
    2.778
    org.owasp.dependencycheck1
    0%
    0/137
    0%
    0/90
    12.5
    All Packages3
    30%
    81/262
    17%
    27/158
    2.778
    org.owasp.dependencycheck1
    0%
    0/138
    0%
    0/90
    12.5
    org.owasp.dependencycheck.cli2
    65%
    81/124
    39%
    27/68
    1.829
    @@ -26,6 +26,6 @@ var packageTable = new SortableTable(document.getElementById("packageResults"), ["String", "Number", "Percentage", "Percentage", "FormattedNumber"]); packageTable.sort(0); - + diff --git a/dependency-check-cli/cobertura/org.owasp.dependencycheck.App.html b/dependency-check-cli/cobertura/org.owasp.dependencycheck.App.html index 9054d639d..05cfdbb7d 100644 --- a/dependency-check-cli/cobertura/org.owasp.dependencycheck.App.html +++ b/dependency-check-cli/cobertura/org.owasp.dependencycheck.App.html @@ -12,7 +12,7 @@
     
    - +
    Classes in this File Line Coverage Branch Coverage Complexity
    App
    0%
    0/137
    0%
    0/90
    12.5
    App
    0%
    0/138
    0%
    0/90
    12.5
     
    @@ -134,284 +134,287 @@
          */
     59  
         public static void main(String[] args) {
    -  60  0
             final App app = new App();
    -  61  0
             app.run(args);
    -  62  0
         }
    -  63   -
     
    +  60   +
             try {
    +  61  0
                 Settings.initialize();
    +  62  0
                 final App app = new App();
    +  63  0
                 app.run(args);
     64   -
         /**
    -  65   -
          * Main CLI entry-point into the application.
    -  66   -
          *
    -  67   -
          * @param args the command line arguments
    -  68   -
          */
    -  69   -
         public void run(String[] args) {
    -  70   -
     
    -  71  0
             final CliParser cli = new CliParser();
    -  72   -
             try {
    -  73  0
                 cli.parse(args);
    -  74  0
             } catch (FileNotFoundException ex) {
    -  75  0
                 System.err.println(ex.getMessage());
    -  76  0
                 cli.printHelp();
    -  77  0
                 return;
    -  78  0
             } catch (ParseException ex) {
    -  79  0
                 System.err.println(ex.getMessage());
    -  80  0
                 cli.printHelp();
    -  81  0
                 return;
    -  82  0
             }
    -  83   -
     
    -  84  0
             final InputStream in = App.class.getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
    -  85  0
             LogUtils.prepareLogger(in, cli.getVerboseLog());
    -  86   -
     
    -  87  0
             if (cli.isGetVersion()) {
    -  88  0
                 cli.printVersionInfo();
    -  89  0
             } else if (cli.isRunScan()) {
    -  90  0
                 populateSettings(cli);
    -  91  0
                 runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles());
    -  92   -
             } else {
    -  93  0
                 cli.printHelp();
    -  94   -
             }
    -  95  0
         }
    -  96   -
     
    -  97   -
         /**
    -  98   -
          * Scans the specified directories and writes the dependency reports to the reportDirectory.
    -  99   -
          *
    -  100   -
          * @param reportDirectory the path to the directory where the reports will be written
    -  101   -
          * @param outputFormat the output format of the report
    -  102   -
          * @param applicationName the application name for the report
    -  103   -
          * @param files the files/directories to scan
    -  104   -
          */
    -  105   -
         private void runScan(String reportDirectory, String outputFormat, String applicationName, String[] files) {
    -  106  0
             Engine scanner = null;
    -  107   -
             try {
    -  108  0
                 scanner = new Engine();
    -  109   -
     
    -  110  0
                 for (String file : files) {
    -  111  0
                     scanner.scan(file);
    -  112   -
                 }
    -  113   -
     
    -  114  0
                 scanner.analyzeDependencies();
    -  115  0
                 final List<Dependency> dependencies = scanner.getDependencies();
    -  116  0
                 DatabaseProperties prop = null;
    -  117  0
                 CveDB cve = null;
    -  118   -
                 try {
    -  119  0
                     cve = new CveDB();
    -  120  0
                     cve.open();
    -  121  0
                     prop = cve.getDatabaseProperties();
    -  122  0
                 } catch (DatabaseException ex) {
    -  123  0
                     LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
    -  124   -
                 } finally {
    -  125  0
                     if (cve != null) {
    -  126  0
                         cve.close();
    -  127   -
                     }
    -  128   -
                 }
    -  129  0
                 final ReportGenerator report = new ReportGenerator(applicationName, dependencies, scanner.getAnalyzers(), prop);
    -  130   -
                 try {
    -  131  0
                     report.generateReports(reportDirectory, outputFormat);
    -  132  0
                 } catch (IOException ex) {
    -  133  0
                     LOGGER.log(Level.SEVERE, "There was an IO error while attempting to generate the report.");
    -  134  0
                     LOGGER.log(Level.FINE, null, ex);
    -  135  0
                 } catch (Throwable ex) {
    -  136  0
                     LOGGER.log(Level.SEVERE, "There was an error while attempting to generate the report.");
    -  137  0
                     LOGGER.log(Level.FINE, null, ex);
    -  138  0
                 }
    -  139  0
             } catch (DatabaseException ex) {
    -  140  0
                 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped");
    -  141  0
                 LOGGER.log(Level.FINE, "", ex);
    -  142  
             } finally {
    -  143  0
                 Settings.cleanup();
    -  144  0
                 if (scanner != null) {
    -  145  0
                     scanner.cleanup();
    -  146   -
                 }
    -  147   -
             }
    -  148  0
         }
    -  149   +  65  0
                 Settings.cleanup();
    +  66  0
             }
    +  67  0
         }
    +  68  
     
    -  150   +  69  
         /**
    -  151   -
          * Updates the global Settings.
    -  152   +  70   +
          * Main CLI entry-point into the application.
    +  71  
          *
    -  153   -
          * @param cli a reference to the CLI Parser that contains the command line arguments used to set the corresponding
    -  154   -
          * settings in the core engine.
    -  155   +  72   +
          * @param args the command line arguments
    +  73  
          */
    -  156   -
         private void populateSettings(CliParser cli) {
    -  157   +  74   +
         public void run(String[] args) {
    +  75  0
             final CliParser cli = new CliParser();
    +  76  
     
    -  158  0
             Settings.initialize();
    -  159   +  77   +
             try {
    +  78  0
                 cli.parse(args);
    +  79  0
             } catch (FileNotFoundException ex) {
    +  80  0
                 System.err.println(ex.getMessage());
    +  81  0
                 cli.printHelp();
    +  82  0
                 return;
    +  83  0
             } catch (ParseException ex) {
    +  84  0
                 System.err.println(ex.getMessage());
    +  85  0
                 cli.printHelp();
    +  86  0
                 return;
    +  87  0
             }
    +  88  
     
    -  160  0
             final boolean autoUpdate = cli.isAutoUpdate();
    -  161  0
             final String connectionTimeout = cli.getConnectionTimeout();
    -  162  0
             final String proxyUrl = cli.getProxyUrl();
    -  163  0
             final String proxyPort = cli.getProxyPort();
    -  164  0
             final String proxyUser = cli.getProxyUsername();
    -  165  0
             final String proxyPass = cli.getProxyPassword();
    -  166  0
             final String dataDirectory = cli.getDataDirectory();
    -  167  0
             final File propertiesFile = cli.getPropertiesFile();
    -  168  0
             final String suppressionFile = cli.getSuppressionFile();
    -  169  0
             final boolean jarDisabled = cli.isJarDisabled();
    -  170  0
             final boolean archiveDisabled = cli.isArchiveDisabled();
    -  171  0
             final boolean assemblyDisabled = cli.isAssemblyDisabled();
    -  172  0
             final boolean nuspecDisabled = cli.isNuspecDisabled();
    -  173  0
             final boolean nexusDisabled = cli.isNexusDisabled();
    -  174  0
             final String nexusUrl = cli.getNexusUrl();
    -  175  0
             final String databaseDriverName = cli.getDatabaseDriverName();
    -  176  0
             final String databaseDriverPath = cli.getDatabaseDriverPath();
    -  177  0
             final String connectionString = cli.getConnectionString();
    -  178  0
             final String databaseUser = cli.getDatabaseUser();
    -  179  0
             final String databasePassword = cli.getDatabasePassword();
    -  180  0
             final String additionalZipExtensions = cli.getAdditionalZipExtensions();
    -  181  0
             final String pathToMono = cli.getPathToMono();
    -  182   +  89  0
             final InputStream in = App.class.getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
    +  90  0
             LogUtils.prepareLogger(in, cli.getVerboseLog());
    +  91  
     
    -  183  0
             if (propertiesFile != null) {
    -  184   +  92  0
             if (cli.isGetVersion()) {
    +  93  0
                 cli.printVersionInfo();
    +  94  0
             } else if (cli.isRunScan()) {
    +  95  0
                 populateSettings(cli);
    +  96  0
                 runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles());
    +  97   +
             } else {
    +  98  0
                 cli.printHelp();
    +  99   +
             }
    +  100  0
         }
    +  101   +
     
    +  102   +
         /**
    +  103   +
          * Scans the specified directories and writes the dependency reports to the reportDirectory.
    +  104   +
          *
    +  105   +
          * @param reportDirectory the path to the directory where the reports will be written
    +  106   +
          * @param outputFormat the output format of the report
    +  107   +
          * @param applicationName the application name for the report
    +  108   +
          * @param files the files/directories to scan
    +  109   +
          */
    +  110   +
         private void runScan(String reportDirectory, String outputFormat, String applicationName, String[] files) {
    +  111  0
             Engine scanner = null;
    +  112   +
             try {
    +  113  0
                 scanner = new Engine();
    +  114   +
     
    +  115  0
                 for (String file : files) {
    +  116  0
                     scanner.scan(file);
    +  117   +
                 }
    +  118   +
     
    +  119  0
                 scanner.analyzeDependencies();
    +  120  0
                 final List<Dependency> dependencies = scanner.getDependencies();
    +  121  0
                 DatabaseProperties prop = null;
    +  122  0
                 CveDB cve = null;
    +  123  
                 try {
    -  185  0
                     Settings.mergeProperties(propertiesFile);
    -  186  0
                 } catch (FileNotFoundException ex) {
    -  187  0
                     final String msg = String.format("Unable to load properties file '%s'", propertiesFile.getPath());
    -  188  0
                     LOGGER.log(Level.SEVERE, msg);
    -  189  0
                     LOGGER.log(Level.FINE, null, ex);
    -  190  0
                 } catch (IOException ex) {
    -  191  0
                     final String msg = String.format("Unable to find properties file '%s'", propertiesFile.getPath());
    -  192  0
                     LOGGER.log(Level.SEVERE, msg);
    -  193  0
                     LOGGER.log(Level.FINE, null, ex);
    -  194  0
                 }
    -  195   +  124  0
                     cve = new CveDB();
    +  125  0
                     cve.open();
    +  126  0
                     prop = cve.getDatabaseProperties();
    +  127  0
                 } catch (DatabaseException ex) {
    +  128  0
                     LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex);
    +  129   +
                 } finally {
    +  130  0
                     if (cve != null) {
    +  131  0
                         cve.close();
    +  132   +
                     }
    +  133   +
                 }
    +  134  0
                 final ReportGenerator report = new ReportGenerator(applicationName, dependencies, scanner.getAnalyzers(), prop);
    +  135   +
                 try {
    +  136  0
                     report.generateReports(reportDirectory, outputFormat);
    +  137  0
                 } catch (IOException ex) {
    +  138  0
                     LOGGER.log(Level.SEVERE, "There was an IO error while attempting to generate the report.");
    +  139  0
                     LOGGER.log(Level.FINE, null, ex);
    +  140  0
                 } catch (Throwable ex) {
    +  141  0
                     LOGGER.log(Level.SEVERE, "There was an error while attempting to generate the report.");
    +  142  0
                     LOGGER.log(Level.FINE, null, ex);
    +  143  0
                 }
    +  144  0
             } catch (DatabaseException ex) {
    +  145  0
                 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped");
    +  146  0
                 LOGGER.log(Level.FINE, "", ex);
    +  147   +
             } finally {
    +  148  0
                 if (scanner != null) {
    +  149  0
                     scanner.cleanup();
    +  150   +
                 }
    +  151  
             }
    -  196   -
             // We have to wait until we've merged the properties before attempting to set whether we use
    +  152  0
         }
    +  153   +
     
    +  154   +
         /**
    +  155   +
          * Updates the global Settings.
    +  156   +
          *
    +  157   +
          * @param cli a reference to the CLI Parser that contains the command line arguments used to set the corresponding
    +  158   +
          * settings in the core engine.
    +  159   +
          */
    +  160   +
         private void populateSettings(CliParser cli) {
    +  161   +
     
    +  162  0
             final boolean autoUpdate = cli.isAutoUpdate();
    +  163  0
             final String connectionTimeout = cli.getConnectionTimeout();
    +  164  0
             final String proxyUrl = cli.getProxyUrl();
    +  165  0
             final String proxyPort = cli.getProxyPort();
    +  166  0
             final String proxyUser = cli.getProxyUsername();
    +  167  0
             final String proxyPass = cli.getProxyPassword();
    +  168  0
             final String dataDirectory = cli.getDataDirectory();
    +  169  0
             final File propertiesFile = cli.getPropertiesFile();
    +  170  0
             final String suppressionFile = cli.getSuppressionFile();
    +  171  0
             final boolean jarDisabled = cli.isJarDisabled();
    +  172  0
             final boolean archiveDisabled = cli.isArchiveDisabled();
    +  173  0
             final boolean assemblyDisabled = cli.isAssemblyDisabled();
    +  174  0
             final boolean nuspecDisabled = cli.isNuspecDisabled();
    +  175  0
             final boolean nexusDisabled = cli.isNexusDisabled();
    +  176  0
             final String nexusUrl = cli.getNexusUrl();
    +  177  0
             final String databaseDriverName = cli.getDatabaseDriverName();
    +  178  0
             final String databaseDriverPath = cli.getDatabaseDriverPath();
    +  179  0
             final String connectionString = cli.getConnectionString();
    +  180  0
             final String databaseUser = cli.getDatabaseUser();
    +  181  0
             final String databasePassword = cli.getDatabasePassword();
    +  182  0
             final String additionalZipExtensions = cli.getAdditionalZipExtensions();
    +  183  0
             final String pathToMono = cli.getPathToMono();
    +  184   +
     
    +  185  0
             if (propertiesFile != null) {
    +  186   +
                 try {
    +  187  0
                     Settings.mergeProperties(propertiesFile);
    +  188  0
                 } catch (FileNotFoundException ex) {
    +  189  0
                     final String msg = String.format("Unable to load properties file '%s'", propertiesFile.getPath());
    +  190  0
                     LOGGER.log(Level.SEVERE, msg);
    +  191  0
                     LOGGER.log(Level.FINE, null, ex);
    +  192  0
                 } catch (IOException ex) {
    +  193  0
                     final String msg = String.format("Unable to find properties file '%s'", propertiesFile.getPath());
    +  194  0
                     LOGGER.log(Level.SEVERE, msg);
    +  195  0
                     LOGGER.log(Level.FINE, null, ex);
    +  196  0
                 }
     197   -
             // the proxy for Nexus since it could be disabled in the properties, but not explicitly stated
    +
             }
     198   +
             // We have to wait until we've merged the properties before attempting to set whether we use
    +  199   +
             // the proxy for Nexus since it could be disabled in the properties, but not explicitly stated
    +  200  
             // on the command line
    -  199  0
             final boolean nexusUsesProxy = cli.isNexusUsesProxy();
    -  200  0
             if (dataDirectory != null) {
    -  201  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
    -  202  0
             } else if (System.getProperty("basedir") != null) {
    -  203  0
                 final File dataDir = new File(System.getProperty("basedir"), "data");
    -  204  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
    -  205  0
             } else {
    -  206  0
                 final File jarPath = new File(App.class.getProtectionDomain().getCodeSource().getLocation().getPath());
    -  207  0
                 final File base = jarPath.getParentFile();
    -  208  0
                 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
    -  209  0
                 final File dataDir = new File(base, sub);
    -  210  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
    -  211   +  201  0
             final boolean nexusUsesProxy = cli.isNexusUsesProxy();
    +  202  0
             if (dataDirectory != null) {
    +  203  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
    +  204  0
             } else if (System.getProperty("basedir") != null) {
    +  205  0
                 final File dataDir = new File(System.getProperty("basedir"), "data");
    +  206  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
    +  207  0
             } else {
    +  208  0
                 final File jarPath = new File(App.class.getProtectionDomain().getCodeSource().getLocation().getPath());
    +  209  0
                 final File base = jarPath.getParentFile();
    +  210  0
                 final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY);
    +  211  0
                 final File dataDir = new File(base, sub);
    +  212  0
                 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath());
    +  213  
             }
    -  212  0
             Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
    -  213  0
             if (proxyUrl != null && !proxyUrl.isEmpty()) {
    -  214  0
                 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
    -  215   +  214  0
             Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
    +  215  0
             if (proxyUrl != null && !proxyUrl.isEmpty()) {
    +  216  0
                 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl);
    +  217  
             }
    -  216  0
             if (proxyPort != null && !proxyPort.isEmpty()) {
    -  217  0
                 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
    -  218   +  218  0
             if (proxyPort != null && !proxyPort.isEmpty()) {
    +  219  0
                 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort);
    +  220  
             }
    -  219  0
             if (proxyUser != null && !proxyUser.isEmpty()) {
    -  220  0
                 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUser);
    -  221   +  221  0
             if (proxyUser != null && !proxyUser.isEmpty()) {
    +  222  0
                 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUser);
    +  223  
             }
    -  222  0
             if (proxyPass != null && !proxyPass.isEmpty()) {
    -  223  0
                 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPass);
    -  224   +  224  0
             if (proxyPass != null && !proxyPass.isEmpty()) {
    +  225  0
                 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPass);
    +  226  
             }
    -  225  0
             if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
    -  226  0
                 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
    -  227   +  227  0
             if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
    +  228  0
                 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
    +  229  
             }
    -  228  0
             if (suppressionFile != null && !suppressionFile.isEmpty()) {
    -  229  0
                 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
    -  230   -
             }
    -  231   -
     
    +  230  0
             if (suppressionFile != null && !suppressionFile.isEmpty()) {
    +  231  0
                 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
     232   -
             //File Type Analyzer Settings
    -  233  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, !jarDisabled);
    -  234  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled);
    -  235  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled);
    -  236  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled);
    -  237   +
             }
    +  233  
     
    -  238  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled);
    -  239  0
             if (nexusUrl != null && !nexusUrl.isEmpty()) {
    -  240  0
                 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
    -  241   +  234   +
             //File Type Analyzer Settings
    +  235  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, !jarDisabled);
    +  236  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled);
    +  237  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled);
    +  238  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled);
    +  239   +
     
    +  240  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled);
    +  241  0
             if (nexusUrl != null && !nexusUrl.isEmpty()) {
    +  242  0
                 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
    +  243  
             }
    -  242  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
    -  243  0
             if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
    -  244  0
                 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
    -  245   +  244  0
             Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
    +  245  0
             if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
    +  246  0
                 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
    +  247  
             }
    -  246  0
             if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
    -  247  0
                 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
    -  248   +  248  0
             if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
    +  249  0
                 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
    +  250  
             }
    -  249  0
             if (connectionString != null && !connectionString.isEmpty()) {
    -  250  0
                 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
    -  251   +  251  0
             if (connectionString != null && !connectionString.isEmpty()) {
    +  252  0
                 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
    +  253  
             }
    -  252  0
             if (databaseUser != null && !databaseUser.isEmpty()) {
    -  253  0
                 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
    -  254   +  254  0
             if (databaseUser != null && !databaseUser.isEmpty()) {
    +  255  0
                 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
    +  256  
             }
    -  255  0
             if (databasePassword != null && !databasePassword.isEmpty()) {
    -  256  0
                 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
    -  257   +  257  0
             if (databasePassword != null && !databasePassword.isEmpty()) {
    +  258  0
                 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
    +  259  
             }
    -  258  0
             if (additionalZipExtensions != null && !additionalZipExtensions.isEmpty()) {
    -  259  0
                 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, additionalZipExtensions);
    -  260   +  260  0
             if (additionalZipExtensions != null && !additionalZipExtensions.isEmpty()) {
    +  261  0
                 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, additionalZipExtensions);
    +  262  
             }
    -  261  0
             if (pathToMono != null && !pathToMono.isEmpty()) {
    -  262  0
                 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
    -  263   -
             }
    -  264  0
         }
    +  263  0
             if (pathToMono != null && !pathToMono.isEmpty()) {
    +  264  0
                 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
     265   +
             }
    +  266  0
         }
    +  267  
     }
    - + diff --git a/dependency-check-cli/cobertura/org.owasp.dependencycheck.cli.CliParser.html b/dependency-check-cli/cobertura/org.owasp.dependencycheck.cli.CliParser.html index 4939b9f6f..b4cd5bb98 100644 --- a/dependency-check-cli/cobertura/org.owasp.dependencycheck.cli.CliParser.html +++ b/dependency-check-cli/cobertura/org.owasp.dependencycheck.cli.CliParser.html @@ -1600,6 +1600,6 @@
     }
    - + diff --git a/dependency-check-cli/dependency-updates-report.html b/dependency-check-cli/dependency-updates-report.html index 6c0b925bd..1eb08d1ca 100644 --- a/dependency-check-cli/dependency-updates-report.html +++ b/dependency-check-cli/dependency-updates-report.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Dependency Updates Report @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/findbugs.html b/dependency-check-cli/findbugs.html index 0a6362007..68e215b5f 100644 --- a/dependency-check-cli/findbugs.html +++ b/dependency-check-cli/findbugs.html @@ -1,13 +1,13 @@ - + dependency-check-cli - FindBugs Bug Detector Report @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/index.html b/dependency-check-cli/index.html index 1f171e1b1..c82631b09 100644 --- a/dependency-check-cli/index.html +++ b/dependency-check-cli/index.html @@ -1,13 +1,13 @@ - + dependency-check-cli - About @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/installation.html b/dependency-check-cli/installation.html index 3b6afb41c..80406a70c 100644 --- a/dependency-check-cli/installation.html +++ b/dependency-check-cli/installation.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Installation & Usage @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • @@ -153,7 +153,7 @@

    Installation & Usage

    -

    Download the dependency-check command line tool here. Extract the zip file to a location on your computer and put the ‘bin’ directory into the path environment variable. On *nix systems you will likely need to make the shell script executable:

    +

    Download the dependency-check command line tool here. Extract the zip file to a location on your computer and put the ‘bin’ directory into the path environment variable. On *nix systems you will likely need to make the shell script executable:

    $ chmod +777 dependency-check.sh
    diff --git a/dependency-check-cli/license.html b/dependency-check-cli/license.html
    index 12c267944..60c6a64c9 100644
    --- a/dependency-check-cli/license.html
    +++ b/dependency-check-cli/license.html
    @@ -1,13 +1,13 @@
     
     
     
       
         
         
    -    
    +    
         
         dependency-check-cli - Project License
         
    @@ -54,7 +54,7 @@
                     
                         
                                   
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • @@ -181,7 +181,210 @@

    Project License

    The Apache Software License, Version 2.0

    -

    Can't read the url [http://www.apache.org/licenses/LICENSE-2.0.txt] : connect timed out

    +
    +
    +                                 Apache License
    +                           Version 2.0, January 2004
    +                        http://www.apache.org/licenses/
    +
    +   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +   1. Definitions.
    +
    +      "License" shall mean the terms and conditions for use, reproduction,
    +      and distribution as defined by Sections 1 through 9 of this document.
    +
    +      "Licensor" shall mean the copyright owner or entity authorized by
    +      the copyright owner that is granting the License.
    +
    +      "Legal Entity" shall mean the union of the acting entity and all
    +      other entities that control, are controlled by, or are under common
    +      control with that entity. For the purposes of this definition,
    +      "control" means (i) the power, direct or indirect, to cause the
    +      direction or management of such entity, whether by contract or
    +      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +      outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +      "You" (or "Your") shall mean an individual or Legal Entity
    +      exercising permissions granted by this License.
    +
    +      "Source" form shall mean the preferred form for making modifications,
    +      including but not limited to software source code, documentation
    +      source, and configuration files.
    +
    +      "Object" form shall mean any form resulting from mechanical
    +      transformation or translation of a Source form, including but
    +      not limited to compiled object code, generated documentation,
    +      and conversions to other media types.
    +
    +      "Work" shall mean the work of authorship, whether in Source or
    +      Object form, made available under the License, as indicated by a
    +      copyright notice that is included in or attached to the work
    +      (an example is provided in the Appendix below).
    +
    +      "Derivative Works" shall mean any work, whether in Source or Object
    +      form, that is based on (or derived from) the Work and for which the
    +      editorial revisions, annotations, elaborations, or other modifications
    +      represent, as a whole, an original work of authorship. For the purposes
    +      of this License, Derivative Works shall not include works that remain
    +      separable from, or merely link (or bind by name) to the interfaces of,
    +      the Work and Derivative Works thereof.
    +
    +      "Contribution" shall mean any work of authorship, including
    +      the original version of the Work and any modifications or additions
    +      to that Work or Derivative Works thereof, that is intentionally
    +      submitted to Licensor for inclusion in the Work by the copyright owner
    +      or by an individual or Legal Entity authorized to submit on behalf of
    +      the copyright owner. For the purposes of this definition, "submitted"
    +      means any form of electronic, verbal, or written communication sent
    +      to the Licensor or its representatives, including but not limited to
    +      communication on electronic mailing lists, source code control systems,
    +      and issue tracking systems that are managed by, or on behalf of, the
    +      Licensor for the purpose of discussing and improving the Work, but
    +      excluding communication that is conspicuously marked or otherwise
    +      designated in writing by the copyright owner as "Not a Contribution."
    +
    +      "Contributor" shall mean Licensor and any individual or Legal Entity
    +      on behalf of whom a Contribution has been received by Licensor and
    +      subsequently incorporated within the Work.
    +
    +   2. Grant of Copyright License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      copyright license to reproduce, prepare Derivative Works of,
    +      publicly display, publicly perform, sublicense, and distribute the
    +      Work and such Derivative Works in Source or Object form.
    +
    +   3. Grant of Patent License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      (except as stated in this section) patent license to make, have made,
    +      use, offer to sell, sell, import, and otherwise transfer the Work,
    +      where such license applies only to those patent claims licensable
    +      by such Contributor that are necessarily infringed by their
    +      Contribution(s) alone or by combination of their Contribution(s)
    +      with the Work to which such Contribution(s) was submitted. If You
    +      institute patent litigation against any entity (including a
    +      cross-claim or counterclaim in a lawsuit) alleging that the Work
    +      or a Contribution incorporated within the Work constitutes direct
    +      or contributory patent infringement, then any patent licenses
    +      granted to You under this License for that Work shall terminate
    +      as of the date such litigation is filed.
    +
    +   4. Redistribution. You may reproduce and distribute copies of the
    +      Work or Derivative Works thereof in any medium, with or without
    +      modifications, and in Source or Object form, provided that You
    +      meet the following conditions:
    +
    +      (a) You must give any other recipients of the Work or
    +          Derivative Works a copy of this License; and
    +
    +      (b) You must cause any modified files to carry prominent notices
    +          stating that You changed the files; and
    +
    +      (c) You must retain, in the Source form of any Derivative Works
    +          that You distribute, all copyright, patent, trademark, and
    +          attribution notices from the Source form of the Work,
    +          excluding those notices that do not pertain to any part of
    +          the Derivative Works; and
    +
    +      (d) If the Work includes a "NOTICE" text file as part of its
    +          distribution, then any Derivative Works that You distribute must
    +          include a readable copy of the attribution notices contained
    +          within such NOTICE file, excluding those notices that do not
    +          pertain to any part of the Derivative Works, in at least one
    +          of the following places: within a NOTICE text file distributed
    +          as part of the Derivative Works; within the Source form or
    +          documentation, if provided along with the Derivative Works; or,
    +          within a display generated by the Derivative Works, if and
    +          wherever such third-party notices normally appear. The contents
    +          of the NOTICE file are for informational purposes only and
    +          do not modify the License. You may add Your own attribution
    +          notices within Derivative Works that You distribute, alongside
    +          or as an addendum to the NOTICE text from the Work, provided
    +          that such additional attribution notices cannot be construed
    +          as modifying the License.
    +
    +      You may add Your own copyright statement to Your modifications and
    +      may provide additional or different license terms and conditions
    +      for use, reproduction, or distribution of Your modifications, or
    +      for any such Derivative Works as a whole, provided Your use,
    +      reproduction, and distribution of the Work otherwise complies with
    +      the conditions stated in this License.
    +
    +   5. Submission of Contributions. Unless You explicitly state otherwise,
    +      any Contribution intentionally submitted for inclusion in the Work
    +      by You to the Licensor shall be under the terms and conditions of
    +      this License, without any additional terms or conditions.
    +      Notwithstanding the above, nothing herein shall supersede or modify
    +      the terms of any separate license agreement you may have executed
    +      with Licensor regarding such Contributions.
    +
    +   6. Trademarks. This License does not grant permission to use the trade
    +      names, trademarks, service marks, or product names of the Licensor,
    +      except as required for reasonable and customary use in describing the
    +      origin of the Work and reproducing the content of the NOTICE file.
    +
    +   7. Disclaimer of Warranty. Unless required by applicable law or
    +      agreed to in writing, Licensor provides the Work (and each
    +      Contributor provides its Contributions) on an "AS IS" BASIS,
    +      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +      implied, including, without limitation, any warranties or conditions
    +      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +      PARTICULAR PURPOSE. You are solely responsible for determining the
    +      appropriateness of using or redistributing the Work and assume any
    +      risks associated with Your exercise of permissions under this License.
    +
    +   8. Limitation of Liability. In no event and under no legal theory,
    +      whether in tort (including negligence), contract, or otherwise,
    +      unless required by applicable law (such as deliberate and grossly
    +      negligent acts) or agreed to in writing, shall any Contributor be
    +      liable to You for damages, including any direct, indirect, special,
    +      incidental, or consequential damages of any character arising as a
    +      result of this License or out of the use or inability to use the
    +      Work (including but not limited to damages for loss of goodwill,
    +      work stoppage, computer failure or malfunction, or any and all
    +      other commercial damages or losses), even if such Contributor
    +      has been advised of the possibility of such damages.
    +
    +   9. Accepting Warranty or Additional Liability. While redistributing
    +      the Work or Derivative Works thereof, You may choose to offer,
    +      and charge a fee for, acceptance of support, warranty, indemnity,
    +      or other liability obligations and/or rights consistent with this
    +      License. However, in accepting such obligations, You may act only
    +      on Your own behalf and on Your sole responsibility, not on behalf
    +      of any other Contributor, and only if You agree to indemnify,
    +      defend, and hold each Contributor harmless for any liability
    +      incurred by, or claims asserted against, such Contributor by reason
    +      of your accepting any such warranty or additional liability.
    +
    +   END OF TERMS AND CONDITIONS
    +
    +   APPENDIX: How to apply the Apache License to your work.
    +
    +      To apply the Apache License to your work, attach the following
    +      boilerplate notice, with the fields enclosed by brackets "[]"
    +      replaced with your own identifying information. (Don't include
    +      the brackets!)  The text should be enclosed in the appropriate
    +      comment syntax for the file format. We also recommend that a
    +      file or class name and description of purpose be included on the
    +      same "printed page" as the copyright notice for easier
    +      identification within third-party archives.
    +
    +   Copyright [yyyy] [name of copyright owner]
    +
    +   Licensed under the Apache License, Version 2.0 (the "License");
    +   you may not use this file except in compliance with the License.
    +   You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    +
    diff --git a/dependency-check-cli/plugin-updates-report.html b/dependency-check-cli/plugin-updates-report.html index 02664a95a..ba338f5d4 100644 --- a/dependency-check-cli/plugin-updates-report.html +++ b/dependency-check-cli/plugin-updates-report.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Plugin Updates Report @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/pmd.html b/dependency-check-cli/pmd.html index 3fcc2f40c..06e222d1a 100644 --- a/dependency-check-cli/pmd.html +++ b/dependency-check-cli/pmd.html @@ -1,13 +1,13 @@ - + dependency-check-cli - PMD Results @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/project-info.html b/dependency-check-cli/project-info.html index 3f1bc8dd0..2dceb55ba 100644 --- a/dependency-check-cli/project-info.html +++ b/dependency-check-cli/project-info.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Project Information @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/project-reports.html b/dependency-check-cli/project-reports.html index 014ed9264..5a489b080 100644 --- a/dependency-check-cli/project-reports.html +++ b/dependency-check-cli/project-reports.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Generated Reports @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • diff --git a/dependency-check-cli/project-summary.html b/dependency-check-cli/project-summary.html index 010b647bd..9cbe1841c 100644 --- a/dependency-check-cli/project-summary.html +++ b/dependency-check-cli/project-summary.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Project Summary @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • @@ -218,7 +218,7 @@ dependency-check-cli Version -1.2.0 +1.2.0.1 Type jar diff --git a/dependency-check-cli/surefire-report.html b/dependency-check-cli/surefire-report.html index 66f6c58d5..0a25ca8d3 100644 --- a/dependency-check-cli/surefire-report.html +++ b/dependency-check-cli/surefire-report.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Surefire Report @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • @@ -267,7 +267,7 @@ function toggleDisplay(elementId) { 0 0 100% -0.039
    +0.046

    Note: failures are anticipated and checked for with assertions while errors are unanticipated.


    Package List

    @@ -288,7 +288,7 @@ function toggleDisplay(elementId) { 0 0 100% -0.039
    +0.046

    Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.

    org.owasp.dependencycheck.cli

    @@ -310,7 +310,7 @@ function toggleDisplay(elementId) { 0 0 100% -0.039

    +0.046

    Test Cases

    [Summary] [Package List] [Test Cases]

    @@ -320,15 +320,15 @@ function toggleDisplay(elementId) { testParse_printHelp -0.03 +0.042 testParse_printVersionInfo -0.001 +0 testParse_help -0.001 +0 testParse_scan @@ -336,15 +336,15 @@ function toggleDisplay(elementId) { testParse -0.001 +0 testParse_unknown -0.001 +0 testParse_version -0.001 +0 testParse_scan_unknownFile diff --git a/dependency-check-cli/taglist.html b/dependency-check-cli/taglist.html index 590a8eb1d..5c2fb7e23 100644 --- a/dependency-check-cli/taglist.html +++ b/dependency-check-cli/taglist.html @@ -1,13 +1,13 @@ - + dependency-check-cli - Tag List report @@ -54,7 +54,7 @@
  • - + /
  • @@ -67,9 +67,9 @@ -
  • | Last Published: 2014-04-28
  • +
  • | Last Published: 2014-04-30
  • - Version: 1.2.0 + Version: 1.2.0.1
  • @@ -240,12 +240,12 @@ Total number of occurrences Tag strings used by tag class -Todo Work +Todo Work 1 todo, FIXME

    Each tag is detailed below:

    -

    Todo Work

    +

    Todo Work

    Number of occurrences found in the code: 1

    diff --git a/dependency-check-cli/xref-test/index.html b/dependency-check-cli/xref-test/index.html index 3239dc502..80aa87879 100644 --- a/dependency-check-cli/xref-test/index.html +++ b/dependency-check-cli/xref-test/index.html @@ -4,7 +4,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference diff --git a/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-frame.html b/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-frame.html index 9df1cd81d..795fbd404 100644 --- a/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-frame.html +++ b/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-frame.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck.cli + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck.cli diff --git a/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-summary.html b/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-summary.html index e9b59d7ab..6fde03b66 100644 --- a/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-summary.html +++ b/dependency-check-cli/xref-test/org/owasp/dependencycheck/cli/package-summary.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck.cli + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck.cli diff --git a/dependency-check-cli/xref-test/overview-frame.html b/dependency-check-cli/xref-test/overview-frame.html index d111efebd..b18002101 100644 --- a/dependency-check-cli/xref-test/overview-frame.html +++ b/dependency-check-cli/xref-test/overview-frame.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference diff --git a/dependency-check-cli/xref-test/overview-summary.html b/dependency-check-cli/xref-test/overview-summary.html index 35e70ab44..9d29e7db2 100644 --- a/dependency-check-cli/xref-test/overview-summary.html +++ b/dependency-check-cli/xref-test/overview-summary.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference @@ -24,7 +24,7 @@ -

    Dependency-Check Command Line 1.2.0 Reference

    +

    Dependency-Check Command Line 1.2.0.1 Reference

    diff --git a/dependency-check-cli/xref/index.html b/dependency-check-cli/xref/index.html index 3239dc502..80aa87879 100644 --- a/dependency-check-cli/xref/index.html +++ b/dependency-check-cli/xref/index.html @@ -4,7 +4,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference diff --git a/dependency-check-cli/xref/org/owasp/dependencycheck/App.html b/dependency-check-cli/xref/org/owasp/dependencycheck/App.html index 130d57593..ce89d660e 100644 --- a/dependency-check-cli/xref/org/owasp/dependencycheck/App.html +++ b/dependency-check-cli/xref/org/owasp/dependencycheck/App.html @@ -65,212 +65,214 @@ 57 * @param args the command line arguments58 */59publicstaticvoid main(String[] args) { -60finalApp app = newApp(); -61 app.run(args); -62 } -63 -64/** -65 * Main CLI entry-point into the application. -66 * -67 * @param args the command line arguments -68 */ -69publicvoid run(String[] args) { -70 -71finalCliParser cli = newCliParser(); -72try { -73 cli.parse(args); -74 } catch (FileNotFoundException ex) { -75 System.err.println(ex.getMessage()); -76 cli.printHelp(); -77return; -78 } catch (ParseException ex) { -79 System.err.println(ex.getMessage()); -80 cli.printHelp(); -81return; -82 } -83 -84final InputStream in = App.class.getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE); -85 LogUtils.prepareLogger(in, cli.getVerboseLog()); -86 -87if (cli.isGetVersion()) { -88 cli.printVersionInfo(); -89 } elseif (cli.isRunScan()) { -90 populateSettings(cli); -91 runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles()); -92 } else { -93 cli.printHelp(); -94 } -95 } -96 -97/** -98 * Scans the specified directories and writes the dependency reports to the reportDirectory. -99 * -100 * @param reportDirectory the path to the directory where the reports will be written -101 * @param outputFormat the output format of the report -102 * @param applicationName the application name for the report -103 * @param files the files/directories to scan -104 */ -105privatevoid runScan(String reportDirectory, String outputFormat, String applicationName, String[] files) { -106 Engine scanner = null; -107try { -108 scanner = new Engine(); -109 -110for (String file : files) { -111 scanner.scan(file); -112 } -113 -114 scanner.analyzeDependencies(); -115final List<Dependency> dependencies = scanner.getDependencies(); -116 DatabaseProperties prop = null; -117 CveDB cve = null; -118try { -119 cve = new CveDB(); -120 cve.open(); -121 prop = cve.getDatabaseProperties(); -122 } catch (DatabaseException ex) { -123 LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex); -124 } finally { -125if (cve != null) { -126 cve.close(); -127 } -128 } -129final ReportGenerator report = new ReportGenerator(applicationName, dependencies, scanner.getAnalyzers(), prop); -130try { -131 report.generateReports(reportDirectory, outputFormat); -132 } catch (IOException ex) { -133 LOGGER.log(Level.SEVERE, "There was an IO error while attempting to generate the report."); -134 LOGGER.log(Level.FINE, null, ex); -135 } catch (Throwable ex) { -136 LOGGER.log(Level.SEVERE, "There was an error while attempting to generate the report."); -137 LOGGER.log(Level.FINE, null, ex); -138 } -139 } catch (DatabaseException ex) { -140 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped"); -141 LOGGER.log(Level.FINE, "", ex); -142 } finally { -143 Settings.cleanup(); -144if (scanner != null) { -145 scanner.cleanup(); -146 } -147 } -148 } -149 -150/** -151 * Updates the global Settings. -152 * -153 * @param cli a reference to the CLI Parser that contains the command line arguments used to set the corresponding -154 * settings in the core engine. -155 */ -156privatevoid populateSettings(CliParser cli) { -157 -158 Settings.initialize(); -159 -160finalboolean autoUpdate = cli.isAutoUpdate(); -161final String connectionTimeout = cli.getConnectionTimeout(); -162final String proxyUrl = cli.getProxyUrl(); -163final String proxyPort = cli.getProxyPort(); -164final String proxyUser = cli.getProxyUsername(); -165final String proxyPass = cli.getProxyPassword(); -166final String dataDirectory = cli.getDataDirectory(); -167final File propertiesFile = cli.getPropertiesFile(); -168final String suppressionFile = cli.getSuppressionFile(); -169finalboolean jarDisabled = cli.isJarDisabled(); -170finalboolean archiveDisabled = cli.isArchiveDisabled(); -171finalboolean assemblyDisabled = cli.isAssemblyDisabled(); -172finalboolean nuspecDisabled = cli.isNuspecDisabled(); -173finalboolean nexusDisabled = cli.isNexusDisabled(); -174final String nexusUrl = cli.getNexusUrl(); -175final String databaseDriverName = cli.getDatabaseDriverName(); -176final String databaseDriverPath = cli.getDatabaseDriverPath(); -177final String connectionString = cli.getConnectionString(); -178final String databaseUser = cli.getDatabaseUser(); -179final String databasePassword = cli.getDatabasePassword(); -180final String additionalZipExtensions = cli.getAdditionalZipExtensions(); -181final String pathToMono = cli.getPathToMono(); -182 -183if (propertiesFile != null) { -184try { -185 Settings.mergeProperties(propertiesFile); -186 } catch (FileNotFoundException ex) { -187final String msg = String.format("Unable to load properties file '%s'", propertiesFile.getPath()); -188 LOGGER.log(Level.SEVERE, msg); -189 LOGGER.log(Level.FINE, null, ex); -190 } catch (IOException ex) { -191final String msg = String.format("Unable to find properties file '%s'", propertiesFile.getPath()); -192 LOGGER.log(Level.SEVERE, msg); -193 LOGGER.log(Level.FINE, null, ex); -194 } -195 } -196// We have to wait until we've merged the properties before attempting to set whether we use -197// the proxy for Nexus since it could be disabled in the properties, but not explicitly stated -198// on the command line -199finalboolean nexusUsesProxy = cli.isNexusUsesProxy(); -200if (dataDirectory != null) { -201 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory); -202 } elseif (System.getProperty("basedir") != null) { -203final File dataDir = new File(System.getProperty("basedir"), "data"); -204 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath()); -205 } else { -206final File jarPath = new File(App.class.getProtectionDomain().getCodeSource().getLocation().getPath()); -207final File base = jarPath.getParentFile(); -208final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY); -209final File dataDir = new File(base, sub); -210 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath()); -211 } -212 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate); -213if (proxyUrl != null && !proxyUrl.isEmpty()) { -214 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl); -215 } -216if (proxyPort != null && !proxyPort.isEmpty()) { -217 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort); -218 } -219if (proxyUser != null && !proxyUser.isEmpty()) { -220 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUser); -221 } -222if (proxyPass != null && !proxyPass.isEmpty()) { -223 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPass); -224 } -225if (connectionTimeout != null && !connectionTimeout.isEmpty()) { -226 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout); -227 } -228if (suppressionFile != null && !suppressionFile.isEmpty()) { -229 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile); -230 } -231 -232//File Type Analyzer Settings -233 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, !jarDisabled); -234 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled); -235 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled); -236 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled); -237 -238 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled); -239if (nexusUrl != null && !nexusUrl.isEmpty()) { -240 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl); -241 } -242 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy); -243if (databaseDriverName != null && !databaseDriverName.isEmpty()) { -244 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName); -245 } -246if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) { -247 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath); -248 } -249if (connectionString != null && !connectionString.isEmpty()) { -250 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString); -251 } -252if (databaseUser != null && !databaseUser.isEmpty()) { -253 Settings.setString(Settings.KEYS.DB_USER, databaseUser); -254 } -255if (databasePassword != null && !databasePassword.isEmpty()) { -256 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword); -257 } -258if (additionalZipExtensions != null && !additionalZipExtensions.isEmpty()) { -259 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, additionalZipExtensions); -260 } -261if (pathToMono != null && !pathToMono.isEmpty()) { -262 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono); -263 } -264 } -265 } +60try { +61 Settings.initialize(); +62finalApp app = newApp(); +63 app.run(args); +64 } finally { +65 Settings.cleanup(); +66 } +67 } +68 +69/** +70 * Main CLI entry-point into the application. +71 * +72 * @param args the command line arguments +73 */ +74publicvoid run(String[] args) { +75finalCliParser cli = newCliParser(); +76 +77try { +78 cli.parse(args); +79 } catch (FileNotFoundException ex) { +80 System.err.println(ex.getMessage()); +81 cli.printHelp(); +82return; +83 } catch (ParseException ex) { +84 System.err.println(ex.getMessage()); +85 cli.printHelp(); +86return; +87 } +88 +89final InputStream in = App.class.getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE); +90 LogUtils.prepareLogger(in, cli.getVerboseLog()); +91 +92if (cli.isGetVersion()) { +93 cli.printVersionInfo(); +94 } elseif (cli.isRunScan()) { +95 populateSettings(cli); +96 runScan(cli.getReportDirectory(), cli.getReportFormat(), cli.getApplicationName(), cli.getScanFiles()); +97 } else { +98 cli.printHelp(); +99 } +100 } +101 +102/** +103 * Scans the specified directories and writes the dependency reports to the reportDirectory. +104 * +105 * @param reportDirectory the path to the directory where the reports will be written +106 * @param outputFormat the output format of the report +107 * @param applicationName the application name for the report +108 * @param files the files/directories to scan +109 */ +110privatevoid runScan(String reportDirectory, String outputFormat, String applicationName, String[] files) { +111 Engine scanner = null; +112try { +113 scanner = new Engine(); +114 +115for (String file : files) { +116 scanner.scan(file); +117 } +118 +119 scanner.analyzeDependencies(); +120final List<Dependency> dependencies = scanner.getDependencies(); +121 DatabaseProperties prop = null; +122 CveDB cve = null; +123try { +124 cve = new CveDB(); +125 cve.open(); +126 prop = cve.getDatabaseProperties(); +127 } catch (DatabaseException ex) { +128 LOGGER.log(Level.FINE, "Unable to retrieve DB Properties", ex); +129 } finally { +130if (cve != null) { +131 cve.close(); +132 } +133 } +134final ReportGenerator report = new ReportGenerator(applicationName, dependencies, scanner.getAnalyzers(), prop); +135try { +136 report.generateReports(reportDirectory, outputFormat); +137 } catch (IOException ex) { +138 LOGGER.log(Level.SEVERE, "There was an IO error while attempting to generate the report."); +139 LOGGER.log(Level.FINE, null, ex); +140 } catch (Throwable ex) { +141 LOGGER.log(Level.SEVERE, "There was an error while attempting to generate the report."); +142 LOGGER.log(Level.FINE, null, ex); +143 } +144 } catch (DatabaseException ex) { +145 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped"); +146 LOGGER.log(Level.FINE, "", ex); +147 } finally { +148if (scanner != null) { +149 scanner.cleanup(); +150 } +151 } +152 } +153 +154/** +155 * Updates the global Settings. +156 * +157 * @param cli a reference to the CLI Parser that contains the command line arguments used to set the corresponding +158 * settings in the core engine. +159 */ +160privatevoid populateSettings(CliParser cli) { +161 +162finalboolean autoUpdate = cli.isAutoUpdate(); +163final String connectionTimeout = cli.getConnectionTimeout(); +164final String proxyUrl = cli.getProxyUrl(); +165final String proxyPort = cli.getProxyPort(); +166final String proxyUser = cli.getProxyUsername(); +167final String proxyPass = cli.getProxyPassword(); +168final String dataDirectory = cli.getDataDirectory(); +169final File propertiesFile = cli.getPropertiesFile(); +170final String suppressionFile = cli.getSuppressionFile(); +171finalboolean jarDisabled = cli.isJarDisabled(); +172finalboolean archiveDisabled = cli.isArchiveDisabled(); +173finalboolean assemblyDisabled = cli.isAssemblyDisabled(); +174finalboolean nuspecDisabled = cli.isNuspecDisabled(); +175finalboolean nexusDisabled = cli.isNexusDisabled(); +176final String nexusUrl = cli.getNexusUrl(); +177final String databaseDriverName = cli.getDatabaseDriverName(); +178final String databaseDriverPath = cli.getDatabaseDriverPath(); +179final String connectionString = cli.getConnectionString(); +180final String databaseUser = cli.getDatabaseUser(); +181final String databasePassword = cli.getDatabasePassword(); +182final String additionalZipExtensions = cli.getAdditionalZipExtensions(); +183final String pathToMono = cli.getPathToMono(); +184 +185if (propertiesFile != null) { +186try { +187 Settings.mergeProperties(propertiesFile); +188 } catch (FileNotFoundException ex) { +189final String msg = String.format("Unable to load properties file '%s'", propertiesFile.getPath()); +190 LOGGER.log(Level.SEVERE, msg); +191 LOGGER.log(Level.FINE, null, ex); +192 } catch (IOException ex) { +193final String msg = String.format("Unable to find properties file '%s'", propertiesFile.getPath()); +194 LOGGER.log(Level.SEVERE, msg); +195 LOGGER.log(Level.FINE, null, ex); +196 } +197 } +198// We have to wait until we've merged the properties before attempting to set whether we use +199// the proxy for Nexus since it could be disabled in the properties, but not explicitly stated +200// on the command line +201finalboolean nexusUsesProxy = cli.isNexusUsesProxy(); +202if (dataDirectory != null) { +203 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory); +204 } elseif (System.getProperty("basedir") != null) { +205final File dataDir = new File(System.getProperty("basedir"), "data"); +206 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath()); +207 } else { +208final File jarPath = new File(App.class.getProtectionDomain().getCodeSource().getLocation().getPath()); +209final File base = jarPath.getParentFile(); +210final String sub = Settings.getString(Settings.KEYS.DATA_DIRECTORY); +211final File dataDir = new File(base, sub); +212 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath()); +213 } +214 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate); +215if (proxyUrl != null && !proxyUrl.isEmpty()) { +216 Settings.setString(Settings.KEYS.PROXY_URL, proxyUrl); +217 } +218if (proxyPort != null && !proxyPort.isEmpty()) { +219 Settings.setString(Settings.KEYS.PROXY_PORT, proxyPort); +220 } +221if (proxyUser != null && !proxyUser.isEmpty()) { +222 Settings.setString(Settings.KEYS.PROXY_USERNAME, proxyUser); +223 } +224if (proxyPass != null && !proxyPass.isEmpty()) { +225 Settings.setString(Settings.KEYS.PROXY_PASSWORD, proxyPass); +226 } +227if (connectionTimeout != null && !connectionTimeout.isEmpty()) { +228 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout); +229 } +230if (suppressionFile != null && !suppressionFile.isEmpty()) { +231 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile); +232 } +233 +234//File Type Analyzer Settings +235 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, !jarDisabled); +236 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled); +237 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled); +238 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled); +239 +240 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, !nexusDisabled); +241if (nexusUrl != null && !nexusUrl.isEmpty()) { +242 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl); +243 } +244 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy); +245if (databaseDriverName != null && !databaseDriverName.isEmpty()) { +246 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName); +247 } +248if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) { +249 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath); +250 } +251if (connectionString != null && !connectionString.isEmpty()) { +252 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString); +253 } +254if (databaseUser != null && !databaseUser.isEmpty()) { +255 Settings.setString(Settings.KEYS.DB_USER, databaseUser); +256 } +257if (databasePassword != null && !databasePassword.isEmpty()) { +258 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword); +259 } +260if (additionalZipExtensions != null && !additionalZipExtensions.isEmpty()) { +261 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, additionalZipExtensions); +262 } +263if (pathToMono != null && !pathToMono.isEmpty()) { +264 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono); +265 } +266 } +267 }
    diff --git a/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-frame.html b/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-frame.html index 9e138a482..2dca67506 100644 --- a/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-frame.html +++ b/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-frame.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck.cli + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck.cli diff --git a/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-summary.html b/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-summary.html index 645006bb0..2564f54d1 100644 --- a/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-summary.html +++ b/dependency-check-cli/xref/org/owasp/dependencycheck/cli/package-summary.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck.cli + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck.cli diff --git a/dependency-check-cli/xref/org/owasp/dependencycheck/package-frame.html b/dependency-check-cli/xref/org/owasp/dependencycheck/package-frame.html index a010b2d79..3278f601b 100644 --- a/dependency-check-cli/xref/org/owasp/dependencycheck/package-frame.html +++ b/dependency-check-cli/xref/org/owasp/dependencycheck/package-frame.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck diff --git a/dependency-check-cli/xref/org/owasp/dependencycheck/package-summary.html b/dependency-check-cli/xref/org/owasp/dependencycheck/package-summary.html index 07cbdc251..cafb960fb 100644 --- a/dependency-check-cli/xref/org/owasp/dependencycheck/package-summary.html +++ b/dependency-check-cli/xref/org/owasp/dependencycheck/package-summary.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference Package org.owasp.dependencycheck + Dependency-Check Command Line 1.2.0.1 Reference Package org.owasp.dependencycheck diff --git a/dependency-check-cli/xref/overview-frame.html b/dependency-check-cli/xref/overview-frame.html index 338860915..4ab0b4f17 100644 --- a/dependency-check-cli/xref/overview-frame.html +++ b/dependency-check-cli/xref/overview-frame.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference diff --git a/dependency-check-cli/xref/overview-summary.html b/dependency-check-cli/xref/overview-summary.html index e018b4d4c..980cc5ca8 100644 --- a/dependency-check-cli/xref/overview-summary.html +++ b/dependency-check-cli/xref/overview-summary.html @@ -3,7 +3,7 @@ - Dependency-Check Command Line 1.2.0 Reference + Dependency-Check Command Line 1.2.0.1 Reference @@ -24,7 +24,7 @@ -

    Dependency-Check Command Line 1.2.0 Reference

    +

    Dependency-Check Command Line 1.2.0.1 Reference