MoSKito 2.5.6 Inspect不显示带注释的类

时间:2015-03-25 15:17:43

标签: spring maven tomcat7 java-8

我正在使用the MoSKito integration guide为我的maven + spring java-8项目运行moskito监控。除了我在MoSKito Inspect中看不到我带注释的服务和控制器外,一切正常。

我尝试了教程附带的示例项目burgershop(标签:moskito-integration-guide-step1)。由于无法编译项目,我修改了pom.xml以使用aspectj v1.7,moskito 2.5.6和moskito-inspect-remote工件。通过这些修改,我能够编译和连接moskito Inspect与项目。但是我仍然看不到教程描述的带注释的控制器和服务类。有人能帮忙吗?

控制器使用@Monitor属性进行注释。

(pom.xml的修改)

<properties>
    <moskito.version>2.5.6</moskito.version>
</properties>
...
<dependencies>
    ...
    <dependency>
        <groupId>net.anotheria</groupId>
        <artifactId>moskito-inspect-remote</artifactId>
        <version>${moskito.version}</version>
    </dependency>

    <dependency>
        <groupId>net.anotheria</groupId>
        <artifactId>moskito-core</artifactId>
        <version>${moskito.version}</version>
    </dependency>
    <dependency>
        <groupId>net.anotheria</groupId>
        <artifactId>moskito-aop</artifactId>
        <version>${moskito.version}</version>
    </dependency>
 </dependencies>
 ...
 <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>aspectj-maven-plugin</artifactId>
     <version>1.7</version>
         <configuration>
             <aspectLibraries>
                 <aspectLibrary>
                     <groupId>net.anotheria</groupId>
                     <artifactId>moskito-aop</artifactId>
                 </aspectLibrary>
             </aspectLibraries>
          <complianceLevel>1.8</complianceLevel>
             <source>1.8</source>
             <target>1.8</target>
         </configuration>
         <executions>
             <execution>
                 <goals>
                     <goal>compile</goal>
                 </goals>
             </execution>
         </executions>
     </plugin>
     ...

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。尝试使用jdk 7和我的插件部分的示例:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>${java.level}</source>
                <target>${java.level}</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <aspectLibraries>
                    <aspectLibrary>
                        <groupId>net.anotheria</groupId>
                        <artifactId>moskito-aop</artifactId>
                    </aspectLibrary>
                </aspectLibraries>
                <complianceLevel>${java.level}</complianceLevel>
                <sourse>${java.level}</sourse>
                <target>${java.level}</target>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>