Skip to content

Commit 9e746ae

Browse files
author
kevin.w.wall
committed
Added instructions of how to get examples to compile and work when retrieved from .zip file from Google Code site.
1 parent eff1cb6 commit 9e746ae

1 file changed

Lines changed: 105 additions & 4 deletions

File tree

src/examples/README

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,116 @@
11
README - This file you are now reading.
22
java - Some Java examples.
3-
scripts - Some scripts to run that interact with the Java examples.
3+
scripts - Some scripts to run that interact with the Java examples (but see
4+
below).
45

56

67
NOTE: All scripts are meant to be run under *nix (or using something like
7-
Cygwin under Windows) from under the 'scripts' directory.
8+
Cygwin under Windows) from under the 'scripts' directory using either
9+
bash or KornShell
810

911
E.g., to compile the Java examples, execute:
1012

11-
$ cd scripts; ./compile.sh
13+
$ cd scripts; sh ./compile.sh
1214

1315
and NOT
1416

15-
$ scripts/compile.sh
17+
$ sh scripts/compile.sh
18+
19+
To run the other scripts, you minimally will need to make findjar.sh
20+
executable by yourself; e.g.,
21+
22+
$ chmod u+x scripts/findjar.sh
23+
24+
25+
26+
Note that as delivered, these scripts are configured to run from
27+
Eclipse or Maven as pulled directly from the ESAPI Subversion
28+
repository.
29+
30+
If instead, you are using these scripts as part of a generally available
31+
(GA) or release candidate (RC) release as extracted from the zip file
32+
on Google Code, from
33+
http://code.google.com/p/owasp-esapi-java/downloads/list
34+
then if you wish to make some minor edits to these scripts.
35+
Specifically, you will need to edit the setting of the classpath.
36+
[Note: I will try to fix this so this adjusts automagically starting
37+
with whatever release follows ESAPI 2.0-rc6, but do not have time to
38+
fix it now. -- Kevin Wall <[email protected]>]
39+
40+
* * * * * * * * * * * * * * * * * * * *
41+
Changes only needed if you want to use the examples
42+
and have downloaded the zip file from Google Code.
43+
If you are pulling source from ESAPI SVN repository
44+
and using either Eclipse or Maven to build ESAPI, these
45+
should work w/out any change.
46+
* * * * * * * * * * * * * * * * * * * *
47+
48+
=====> In scripts/compile.sh:
49+
Change
50+
javac -classpath .:../../../target/ESAPI-2.0.jar *.java
51+
to
52+
javac -classpath .:$(ls ../../../../ESAPI*.jar) *.java
53+
54+
=====> In scripts/findjar.sh ... no change needed.
55+
56+
=====> In scripts/persistEncryptedData.sh:
57+
Change:
58+
59+
classpath=".:../../../target/ESAPI-2.0.jar:\
60+
$(./findjar.sh log4j-1.2.12.jar):\
61+
$(./findjar.sh commons-fileupload-1.2.jar):\
62+
$(./findjar.sh servlet-api-2.4.jar)"
63+
64+
to:
65+
66+
startDir=../../../../libs
67+
68+
classpath=".:$(ls ../../../../ESAPI*.jar):\
69+
$(./findjar.sh -start $startDir log4j-1.2.12.jar):\
70+
$(./findjar.sh -start $startDir commons-fileupload-1.2.jar):\
71+
$(./findjar.sh -start $startDir servlet-api-2.4.jar)"
72+
73+
Change lines 13 & 14 from:
74+
java -Dlog4j.configuration=./src/test/resources/log4j.xml \
75+
-Dorg.owasp.esapi.resources="configuration/.esapi" \
76+
77+
to:
78+
java -Dlog4j.configuration=../../../../configuration/log4j.xml \
79+
-Dorg.owasp.esapi.resources="../../../../configuration/.esapi" \
80+
81+
82+
=====> In scripts/setMasterKey.sh
83+
84+
Change line 5 from
85+
cd ../../..
86+
to:
87+
cd ../../../..
88+
89+
Change line 10 from
90+
else esapi_props="src/main/resources/.esapi/ESAPI.properties"
91+
to:
92+
else esapi_props="project/src/main/resources/.esapi/ESAPI.properties"
93+
94+
Change lines 18-21 from:
95+
96+
classpath=".:target/ESAPI-2.0.jar:\
97+
$($findjar log4j-1.2.12.jar):\
98+
$($findjar commons-fileupload-1.2.jar):\
99+
$($findjar servlet-api-2.4.jar)"
100+
101+
to:
102+
103+
classpath=".:$(ls ESAPI*.jar):\
104+
$($findjar -start $PWD/libs log4j-1.2.12.jar):\
105+
$($findjar -start $PWD/libs commons-fileupload-1.2.jar):\
106+
$($findjar -start $PWD/libs servlet-api-2.4.jar)"
107+
108+
Change lines 24 & 25 from:
109+
java -Dlog4j.configuration=src/test/resources/log4j.xml \
110+
-Dorg.owasp.esapi.resources=$esapi_props \
111+
112+
to:
113+
java -Dlog4j.configuration=configuration/log4j.xml \
114+
-Dorg.owasp.esapi.resources=$(dirname $esapi_props) \
115+
116+
Apologies for the inconvenience. This will be fixed next GA or RC release.

0 commit comments

Comments
 (0)