2012-06-27 3 views
1

Après quelques essais, je ne parviens pas à faire fonctionner le mode hébergé avec maven. Mon pom.xml est le suivant et j'utilise une structure maven standard:GWT Maven hébergé mode

 <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>gwt-maven-plugin</artifactId> 
      <version>2.4.0</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>compile</goal> 
         <goal>i18n</goal> 
         <goal>generateAsync</goal> 
        </goals> 
       </execution> 
      </executions> 

      <configuration> 
       <draftCompile>true</draftCompile> 
       <strict>true</strict> 
       <inplace>false</inplace> 
       <runTarget>project.html</runTarget> 
       <style>${gwt.style}</style> 
       <i18nMessagesBundle>com.domain.client.i18n.Messages</i18nMessagesBundle> 
       <i18nConstantsBundle>comdomain.client.properties.ClientProperties</i18nConstantsBundle> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1.1</version> 
      <executions> 
       <execution> 
        <phase>compile</phase> 
        <goals> 
         <goal>exploded</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

Des idées?

+0

Depuis le poste que je l'ai mis à jour à GWT 2.5 et il travaille hors de la boîte. Je n'ai toujours pas réussi à le faire fonctionner avec 2.4 – krampstudio

Répondre

1

Essayez d'ajouter ces entrées de configuration:

<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>       
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> 
<hostedWebapp>${basedir}/src/main/webapp</hostedWebapp> 

Le dernier peut être le vrai besoin d'un fait

+0

Je reçois toujours le message d'erreur suivant: '[AVERTISSEMENT] Votre répertoire POM ne correspond pas à votre dossier web WEB-INF/classes hébergé pour GWT navigateur hébergé pour voir vos classes ' – krampstudio

+0

laissez simplement vos classes compilées dans/src/main/webapp/WEB-INF/classes pour le faire fonctionner :) – Arcadien

1

j'ai remarqué deux balises manquantes <outputDirectory> sous construction et <module> sous configurations GWT-maven-plugin.

également référence - http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/dynatablerf/pom.xml

<build> 
    <!-- Generate compiled stuff in the folder used for development mode --> 
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> 

    <plugins> 

     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.4</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     <dependencies> 
      <!-- Need to run the RF Validation tool. This works on both the command-line 
       and in Eclipse, provided that m2e-apt is installed. --> 
      <dependency> 
      <groupId>com.google.web.bindery</groupId> 
      <artifactId>requestfactory-apt</artifactId> 
      <version>${gwtVersion}</version> 
      </dependency> 
     </dependencies> 
     </plugin> 

     <!-- GWT Maven Plugin--> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>gwt-maven-plugin</artifactId>   
     <version>2.5.0</version> 
     <dependencies> 
      <dependency> 
      <groupId>com.google.gwt</groupId> 
      <artifactId>gwt-user</artifactId> 
      <version>${gwtVersion}</version> 
      </dependency> 
      <dependency> 
      <groupId>com.google.gwt</groupId> 
      <artifactId>gwt-dev</artifactId> 
      <version>${gwtVersion}</version> 
      </dependency> 
     </dependencies> 
     <!-- JS is only needed in the package phase, this speeds up testing --> 
     <executions> 
      <execution> 
      <phase>prepare-package</phase> 
      <goals> 
       <goal>compile</goal> 
       <goal>i18n</goal> 
       <goal>generateAsync</goal> 
      </goals> 
      </execution> 
     </executions> 

     <!-- Plugin configuration. There are many available options, 
      see gwt-maven-plugin documentation at codehaus.org --> 
     <configuration> 
      <draftCompile>true</draftCompile> 
      <strict>true</strict> 
      <inplace>false</inplace> 
      <!-- URL that should be automatically opened in the GWT shell (gwt:run). --> 
      <runTarget>project.html</runTarget> 
      <style>${gwt.style}</style> 
      <i18nMessagesBundle>com.domain.client.i18n.Messages</i18nMessagesBundle> 
      <i18nConstantsBundle>comdomain.client.properties.ClientProperties</i18nConstantsBundle>   
      <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) --> 
      <compileReport>true</compileReport> 
      <module>youR.gwt.ModuleName</module> 
      <logLevel>INFO</logLevel> 
      <copyWebapp>true</copyWebapp> 
     </configuration> 
     </plugin> 
Questions connexes