1.jamon好象没有提供maven的dependency.
将最新的jamonall_27.zip文件中的所有5个jar(2个外部jar,war中的三个jar)安装到本地的仓库里。
mvn install:install-file -DgroupId=com.jamon -DartifactId=jamon -Dversion=2.7 -Dpackaging=jar -Dfile=/home/gaoyibo/tools/apache-maven-2.0.9/lib/jamon/jamon-2.7.jar
mvn install:install-file -DgroupId=com.jamontomcat -DartifactId=jamontomcat -Dversion=2.7 -Dpackaging=jar -Dfile=/home/gaoyibo/tools/apache-maven-2.0.9/lib/jamon/jamontomcat-2.7.jar
mvn install:install-file -DgroupId=jakarta-oro -DartifactId=jakarta-oro -Dversion=2.0.8 -Dpackaging=jar -Dfile=/home/gaoyibo/tools/apache-maven-2.0.9/lib/jamon/jakarta-oro-2.0.8.jar
mvn install:install-file -DgroupId=com.fdsapi -DartifactId=fdsapi -Dversion=1.2 -Dpackaging=jar -Dfile=/home/gaoyibo/tools/apache-maven-2.0.9/lib/jamon/fdsapi-1.2.jar
mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=0.1 -Dpackaging=jar -Dfile=/home/gaoyibo/tools/apache-maven-2.0.9/lib/jamon/hsqldb.jar
2。在pom.xml中添加
<dependency>
<groupId>com.jamon</groupId>
<artifactId>jamon</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.jamontomcat</groupId>
<artifactId>jamontomcat</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.fdsapi</groupId>
<artifactId>fdsapi</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>jakarta-oro</groupId>
<artifactId>jakarta-oro</artifactId>
<version>2.0.8</version>
</dependency>
3.在applicationContext中添加拦截器:
<bean
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>jamonInterceptor</value>
</list>
</property>
</bean>
<bean id="jamonInterceptor"
class="org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor">
</bean>
4.log4j中添加log4j.logger.org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor = TRACE
5.在webapp下新建一个jamon,将war中解压后的css/image/jsp扔到里面。
6.maven package之后,可以使用http://localhost/appname/jamon/menu.jsp访问。