-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
47 lines (40 loc) · 1.79 KB
/
README
File metadata and controls
47 lines (40 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Code for my presentation of code injection at JavaZone 2011
Get the code, run it and look for 'THE INJECTED CODE SAYS:' in its output.
= Getting the code =
Point your browser to
https://github.com/jakubholynet/JavaZone-Code-Injection/zipball/master
and a ZIP archive download should start.
= Running the examples with Maven =
I've been using Maven 2.2.1.
cd /path/into/the/downloaded/folder/where/pom.xml/is
1. Java Proxy:
mvn -P javaproxy test
2. Javassist:
mvn -P javassist test
3. AspectJ:
mvn -P aspectj test
= Running the examples manually =
* Get the dependencies described in pom.xml and their transitive dependencies
* Compile the sources
* Run them:
*# Java Proxy:
*## java -classpath <the dependencies listed below:/path/to/classes> iterate.jz2011.codeinjection.javaproxy.Main
*# Javassist:
*## java -classpath /path/to/javassist-3.14.0-GA.jar:/path/to/classes iterate.jz2011.codeinjection.javassist.JavassistInstrumenter
*## java -classpath target/javassist:/path/to/classes iterate.jz2011.codeinjection.javassist.Main
*# AspectJ:
*## In aspectj-inject-build.xml define maven.plugin.classpath as described
*## ant -f aspectj-inject-build.xml
*## java -classpath "/path/to/classes:/path/to/aspectjrt-1.6.10.jar" iterate.jz2011.codeinjection.aspectj.Main
Dependencies for the Java Proxy example:
+- net.jakubholy.testing:dbunit-embeddedderby-parenttest:jar:1.2.0:compile
| +- org.apache.derby:derby:jar:10.3.2.1:compile
| +- org.dbunit:dbunit:jar:2.4.7:compile
| | \- commons-collections:commons-collections:jar:3.2.1:compile
| +- junit:junit:jar:3.8.2:compile
| \- org.slf4j:slf4j-api:jar:1.5.6:compile
\- org.slf4j:slf4j-simple:jar:1.5.6:runtime
= License =
The code is in the public domain and fully available for any use, i.e. no licensing issues.
= Copyleft =
Jakub Holy of Iterate AS, 2011