1

我正在使用 Maven、GWTP 并收到此错误:描述资源路径位置类型 JAX-RS(REST Web 服务)2.0 需要动态 Web 模块 3.1 或更高版本。示例行 1 Maven Java EE 配置问题

我的 Pom.xml 是:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-   4.0.0.xsd">


<modelVersion>4.0.0</modelVersion>

  <groupId>com.sample</groupId>
  <artifactId>sample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>GWTP Basic with GXT</name>
  <description>Basic GWTP application with the GXT, Rest, Spring libraries</description>

  <properties>
    <!-- client -->
    <!-- Get the latest GXT release through support 3.0.6... -->
    <gxt.version>3.0.1</gxt.version>
    <gwt.version>2.5.1</gwt.version>
    <gwtp.version>1.0</gwtp.version>
    <gin.version>2.0.0</gin.version>
    <gwtquery.version>1.3.2</gwtquery.version>


    <!-- server -->
    <guice.version>3.0</guice.version>
    <mysql.version>5.1.26</mysql.version>

    <spring.version>3.2.4.RELEASE</spring.version>


    <!-- testing -->
    <junit.version>4.11</junit.version>
    <jukito.version>1.1</jukito.version>

    <!-- maven -->
    <gwt-maven-plugin.version>2.5.1</gwt-maven-plugin.version>
    <maven-surefire-plugin.version>2.6</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version>
    <maven-resources-plugin.version>2.5</maven-resources-plugin.version>
    <maven-processor-plugin.version>2.0.5</maven-processor-plugin.version>
    <maven-build-helper-plugin.version>1.7</maven-build-helper-plugin.version>

    <target.jdk>1.7</target.jdk>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- REST -->
    <resteasy.version>3.0.2.Final</resteasy.version>
    <arcbees.version>1.1.1</arcbees.version>

    <!-- GAE -->
    <gae.version>1.7.7</gae.version>
    <gae.home>${settings.localRepository}/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}</gae.home>

    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
  </properties>

  <build>
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

    <plugins>



        <plugin>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${gae.version}</version>
        </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${target.jdk}</source>
          <target>${target.jdk}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <!-- JUnit Testing - skip *.GwtTest cases -->
      <!-- 'mvn test' - runs the Junit tests -->
      <!-- 'mvn integration-test` - runs GWT test cases -->
      <!-- 'mvn integration-test -P selenium-local` - runs GWT selenium unit test cases -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
          </includes>
          <excludes>
            <exclude>**/*GwtTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <!-- GWT -->
      <!-- 'mvn gwt:run' - runs development mode -->
      <!-- 'mvn gwt:debug' - runs debug mode -->
      <!-- 'mvn gwt:compile' - compiles gwt -->
      <!-- 'mvn integration-test' - runs the gwt tests (*GwtTest.java) -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwt.version}</version>
        <configuration>
          <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
          <strict>true</strict>

          <testTimeOut>180</testTimeOut>
          <includes>**/*GwtTestSuite.java</includes>
          <excludes>**/*GwtTest.java</excludes>
          <mode>htmlunit</mode>

          <extraJvmArgs>-Xss1024K -Xmx1024M -XX:MaxPermSize=256M</extraJvmArgs>
          <logLevel>INFO</logLevel>
          <style>${gwt.style}</style>

          <copyWebapp>true</copyWebapp>
          <hostedWebapp>${webappDirectory}</hostedWebapp>

          <runTarget>Sample.html</runTarget>
          <modules>
            <module>com.sample.Sample</module>
          </modules>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

     </plugins>


  </build>

  <!-- Get the latest release through support, 3.0.6... -->
  <!-- <repositories> -->
    <!-- <repository> -->
      <!-- ~/.m2/settings.xml add <server/> with same id here with login credentials -->
      <!-- <id>sencha-gxt-repository</id> -->
      <!-- <name>Sencha GXT Repository</name> -->
      <!-- Support Subscribers Only: Subscribe to support for -->
      <!-- Latest GPL Support GXT Versions -->
      <!-- <url>https://maven.sencha.com/repo/gxt-support-gpl-release</url> -->
      <!-- Commercial Support GXT Versions -->
      <!-- <url>https://maven.sencha.com/repo/gxt-commercial-release</url> -->
    <!-- </repository> -->
  <!-- </repositories> -->

  <dependencies>

          <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-1.0-sdk</artifactId>
        <version>${gae.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <!-- GXT -->
    <!-- http://docs.sencha.com/gxt-guides/3/ -->
    <dependency>
      <groupId>com.sencha.gxt</groupId>
      <artifactId>gxt</artifactId>
      <version>${gxt.version}</version>
    </dependency>
    <dependency>
      <groupId>com.sencha.gxt</groupId>
      <artifactId>gxt-chart</artifactId>
      <version>${gxt.version}</version>
    </dependency>

    <!-- Google Web Toolkit -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
    </dependency>

    <!-- GWT-Platform -->
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-mvp-client</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-client</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-server-guice</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
        <groupId>com.gwtplatform</groupId>
        <artifactId>gwtp-dispatch-rest</artifactId>
        <version>${gwtp.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-shared</artifactId>
      <version>${gwtp.version}</version>
    </dependency>



    <!-- DI -->
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-servlet</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-assistedinject</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.gwt.inject</groupId>
      <artifactId>gin</artifactId>
      <version>${gin.version}</version>
    </dependency>

    <!-- OTHER -->
    <dependency>
        <groupId>org.mindrot</groupId>
        <artifactId>jbcrypt</artifactId>
        <version>0.3m</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.objectify</groupId>
        <artifactId>objectify</artifactId>
        <version>4.0b3</version>
         <exclusions>
        <exclusion>
            <groupId>com.google.appengine</groupId>
            <artifactId>*</artifactId> 
            <!-- com.google.appengine:appengine-api-1.0-sdk:jar:1.7.6:compile
[INFO] |  \- com.google.appengine:appengine-api-labs:jar:1.7.6:compile 
mvn dependency:tree -->
        </exclusion>
    </exclusions> 
     </dependency>
     <dependency>
        <groupId>com.googlecode.gwtquery</groupId>
        <artifactId>gwtquery</artifactId>
        <version>${gwtquery.version}</version>
        <scope>provided</scope>
     </dependency>

     <dependency>
            <groupId>com.arcbees</groupId>
            <artifactId>guicy-resteasy</artifactId>
            <version>${arcbees.version}</version>
     </dependency>

     <dependency>
       <groupId>mysql</groupId>
       <artifactId>mysql-connector-java</artifactId>
       <version>${mysql.version}</version>
     </dependency>


        <!-- REST -->
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>${resteasy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jackson-provider</artifactId>
            <version>${resteasy.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-guice</artifactId>
            <version>${resteasy.version}</version>
        </dependency>    

        <!-- Spring Not spring-core?-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>

    <!-- Test -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jukito</groupId>
      <artifactId>jukito</artifactId>
      <version>${jukito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-remote-driver</artifactId>
      <version>2.33.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>2.33.0</version>
      <scope>test</scope>
    </dependency>





  </dependencies>

  <profiles>
    <!-- run with 'mvn integration-test -P selenium-local' -->

    <!--  -->
    <profile>
      <id>selenium-local</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <configuration>
              <mode>selenium</mode>
              <productionMode>true</productionMode>
              <selenium>localhost:4444/*firefox,localhost:4444/*opera</selenium>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
            <id>phonegap-remote</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>com.sample.PhoneGapRemote</module>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>phonegap-local</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>gwt-maven-plugin</artifactId>
                        <configuration>
                            <module>com.sample.PhoneGapLocal</module>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
  </profiles>
</project>

谢谢,

4

0 回答 0