Sonar Plugin在包结构改变后没有编译

时间:2011-12-04 21:09:41

标签: java gwt sonarqube pom.xml

我正在编写Sonar GWT插件,并且由于包结构发生了变化,插件不再编译。我改变了结构

jku.se.drilldown.ui.client

jku.se.drilldown.client.ui

我将我的pom.xml改编成了这个以及gwt.xml文件,但我总是得到这个错误:

[INFO] [ERROR] Unable to find type 'jku.se.drilldown.client.ui.BenchmarkViewerPanel'
[INFO] [ERROR] Hint: Previous compiler errors may have made this type unavailable
[INFO] [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source

正确的路径条目

这是我的pom.xml,位于文件夹resources / jku / se / drilldown / client下的BenchmarkViewer.gwt.xml文件下面。该插件位于jku.se.drilldown包中,客户端下方的查看器以及ui下面的实际gwt-panel。

http://maven.apache.org/maven-v4_0_0.xsd">     4.0.0     jku.se.drilldown     声纳基准,插件     声纳插件     0.1-SNAPSHOT     Sonar Benchmark插件

<properties>
    <sonar.buildVersion>2.11</sonar.buildVersion>
</properties>

<dependencies>
    <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-plugin-api</artifactId>
        <version>${sonar.buildVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-gwt-api</artifactId>
        <version>${sonar.buildVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-core-gwt</artifactId>
        <version>${sonar.buildVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-ws-client</artifactId>
        <version>${sonar.buildVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-incubator</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
    </dependency>

    <!-- unit tests -->
    <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-testing-harness</artifactId>
        <version>${sonar.buildVersion}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.sonar</groupId>
            <artifactId>sonar-packaging-maven-plugin</artifactId>
            <version>1.1</version>
            <extensions>true</extensions>
            <configuration>
                <pluginClass>jku.se.drilldown.BenchmarkPlugin</pluginClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <configuration>
                        <modules>
                            <module>jku.se.drilldown.client.BenchmarkViewer</module>
                        </modules>
                        <webappDirectory>${project.build.directory}/classes</webappDirectory>
                        <extraJvmArgs>-Xmx512m</extraJvmArgs>
                    </configuration>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>gwt-maven-plugin</artifactId>
                                    <versionRange>[1.2,)</versionRange>
                                    <goals>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.sonar</groupId>
                                    <artifactId>sonar-packaging-maven-plugin</artifactId>
                                    <versionRange>[1.1,)</versionRange>
                                    <goals>
                                        <goal>check-dependencies</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>


                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

</build>

<inherits name='com.google.gwt.user.User' />
<inherits name="org.sonar.Sonar" />

<entry-point class='jku.se.drilldown.client.ui.BenchmarkViewerPanel' />

<extend-property name="locale" values="en" />
<extend-property name="locale" values="fr" />

我正和maven一起建设。希望有人给我一个小费,谢谢!

1 个答案:

答案 0 :(得分:0)

如果BenchmarkViewer.gwt.xml位于….client,那么您必须添加<source path="ui"/><source path=""/>,因为源路径默认为client子包。

或者将BenchmarkViewer.gwt.xml向上移动一个级别(以便client 是一个子包)

相关问题