From ae400c059ac487265143ca0564a53c45a9d36ebc Mon Sep 17 00:00:00 2001 From: Sourabh Katti Date: Fri, 15 Jun 2018 11:05:23 -0700 Subject: [PATCH 1/4] Update DesktopStandaloneApp.md The -Dcontrast.appname is deprecated, it should be -Dcontrast.standalone.appname or -Dcontrast.override.appname, probably the standalone argument --- .../installation/java/installation/DesktopStandaloneApp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/installation/java/installation/DesktopStandaloneApp.md b/content/installation/java/installation/DesktopStandaloneApp.md index 2b9d857e..a836326f 100644 --- a/content/installation/java/installation/DesktopStandaloneApp.md +++ b/content/installation/java/installation/DesktopStandaloneApp.md @@ -4,9 +4,9 @@ description: "Instructions for running Java agent on desktop or standalone app" tags: "java agent desktop installation" --> -The process is pretty much the same, but you have to also pass a name in the ```contrast.appname``` system property under which to collect vulnerabilities. +The process is pretty much the same, but you have to also pass a name in the ```contrast.standalone.appname``` system property under which to collect vulnerabilities. ``` --Dcontrast.appname=AcmeDesktopApp -javaagent:/contrast.jar +-Dcontrast.standalone.appname=AcmeDesktopApp -javaagent:/contrast.jar ``` From 2c38e4948d11738e07f2e05d0c4def45a4832c2d Mon Sep 17 00:00:00 2001 From: Sourabh Katti Date: Fri, 15 Jun 2018 11:06:58 -0700 Subject: [PATCH 2/4] Fixing the appname property The -Dcontrast.appname property is deprecated, should be -Dcontrast.override.appname or -Dcontrast.standalone.appname --- content/installation/java/installation/DropWizard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/installation/java/installation/DropWizard.md b/content/installation/java/installation/DropWizard.md index e0e0ee32..764be41f 100644 --- a/content/installation/java/installation/DropWizard.md +++ b/content/installation/java/installation/DropWizard.md @@ -9,7 +9,7 @@ tags: "java agent installation dropwizard" Here's an example of how to run the Java Agent with your standalone/fatjar Dropwizard application: ```` -java -javaagent:/path/to/contrast.jar -Dcontrast.appname="AppNameToReportUnder" -jar /path/to/your/app.jar server /path/to/your/appconfig.yml +java -javaagent:/path/to/contrast.jar -Dcontrast.standalone.appname="AppNameToReportUnder" -jar /path/to/your/app.jar server /path/to/your/appconfig.yml ```` The Java Agent will not be able to accurately count library usage if your project was configured to shade dependencies into your application's jar. Instead, the Java Agent will report a list of jars based on the information gathered from the pom.properties files provided with the included libraries. From be643f3d18669a72acd248f375c356df14071074 Mon Sep 17 00:00:00 2001 From: Sourabh Katti Date: Fri, 15 Jun 2018 11:13:06 -0700 Subject: [PATCH 3/4] Appname argument fix Changing the appname argument to override.appname or standalone.appname --- content/installation/java/installation/Karaf.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/installation/java/installation/Karaf.md b/content/installation/java/installation/Karaf.md index aa9fa405..e87190bb 100644 --- a/content/installation/java/installation/Karaf.md +++ b/content/installation/java/installation/Karaf.md @@ -21,10 +21,10 @@ Navigate to your application, and allow an extra minute for it to start up. Many Karaf users will probably want to use two extra system properties when running Contrast: * *contrast.classpath.libs*, which tells Contrast to use the standard classpath libraries instead of libraries found in */WEB-INF/lib* - * *contrast.appname*, which allows you to name your application + * *contrast.override.appname*, which allows you to name your application Adding these flags will result in an export that looks more like the following: ``` -$ export KARAF_OPTS="-Dcontrast.appname=MyKarafApp -Dcontrast.classpath.libs=true -javaagent:/path/to/contrast.jar" -``` \ No newline at end of file +$ export KARAF_OPTS="-Dcontrast.override.appname=MyKarafApp -Dcontrast.classpath.libs=true -javaagent:/path/to/contrast.jar" +``` From d12353314be40f867aae89bde0f8c9bdb88db902 Mon Sep 17 00:00:00 2001 From: Sourabh Katti Date: Fri, 15 Jun 2018 11:13:52 -0700 Subject: [PATCH 4/4] Appname fix Changing the appname argument to override.appname or standalone.appname --- content/installation/java/installation/Vertx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/installation/java/installation/Vertx.md b/content/installation/java/installation/Vertx.md index 63453909..38e038f4 100644 --- a/content/installation/java/installation/Vertx.md +++ b/content/installation/java/installation/Vertx.md @@ -67,11 +67,11 @@ Once this is configured, launch the web application via the command **vertx run* vertx run /PATH/TO/YOUR/src/MainVerticle.java ``` -The Vert.x application is unlikely to have a ***/WEB-INF/web.xml*** file, from which the Contrast Java Agent can identify the application name. If this is the case, please define the application name via ```-Dcontrast.appname=AppName``` property when launching the Vert.x application with Contrast enabled. For example: +The Vert.x application is unlikely to have a ***/WEB-INF/web.xml*** file, from which the Contrast Java Agent can identify the application name. If this is the case, please define the application name via ```-Dcontrast.override.appname=AppName``` property when launching the Vert.x application with Contrast enabled. For example: ```bash java -javaagent:/PATH/TO/YOUR/contrast.jar --Dcontrast.appname="" +-Dcontrast.override.appname="" -jar /PATH/TO/YOUR/application.jar ```