Instrumentation

Instrumentation from command line

java -jar jour-instrument-2.0.3.jar --config jour.xml --src classesDir|classes.jar --dst outDir (--classpath classpath) \
     (--copy resource|classes|all) (--systempath)

All command line options:

  • --src implementation : The source JAR or Directory with classes that needs to be instrumented.
  • --classpath jar-one;jar-two;...;jar-n : The supporting Jars for the Source Jar.
  • --systempath : Appends the system search path to the end of the search path.
  • --dst directoryName : The destination directory for instrumented classes
  • --copy resource|classes|all: Also copy non instrumented classes and resources. Default value is none. Only the classes that has been changed are saved in --dst

N.B javassist.jar should be in classpath when running jour.

Building instrumented project using Maven2

<project>
    ...
    <build>
        <plugins>

            <plugin>
                <groupId>net.sf.jour</groupId>
                <artifactId>jour-maven-plugin</artifactId>
                <version>2.0.3</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                        <configuration>
                            <output>classes</output>
                            <jourConfig>${basedir}/process-classes.jour.xml</jourConfig>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>

Building instrumented project using Ant

NOT implemented.