1 Reply Latest reply on Jan 22, 2015 11:47 AM by Divya Dadlani

    Maven with errai and jboss compiling and packaging

    Rico D'Amore Newbie

      Hello.

       

      I'm trying to compile/package an errai/gwt project and deploy it to the jboss7 server.  I am having difficulty getting the profile correct for the jboss server.  At least I think that is my problem.  When I package up the project and deploy it to Jboss I get a window.alert that tells me that superdevmode isn't running on the server and I have to make sure it is running. 

       

      I don't understand what I am doing to make this happen and I'm wondering if anyone can clue me in on what I'm doing wrong by looking at my pom.xml, particularly the jboss profile section. 

       

      My order of operations is: mvn clean, mvn compile, mvn gwt:compile, mvn package, then copy .war to deployments directory on JBoss.

      I think that is correct, anyway here is the pom, thanks for any insight!

       

      <?xml version="1.0" encoding="UTF-8"?>

      <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/maven-v4_0_0.xsd">

       

        <modelVersion>4.0.0</modelVersion>

        <groupId>gov.lanl.queue</groupId>

        <artifactId>Queue</artifactId>

        <packaging>war</packaging>

        <version>1.0-SNAPSHOT</version>

        <name>GWT Maven Archetype</name>

       

        <properties>

          <!-- Convenience property to set the GWT version -->

          <gwtVersion>2.7.0</gwtVersion>

       

          <!-- GWT needs at least java 1.6 -->

          <maven.compiler.source>1.7</maven.compiler.source>

          <maven.compiler.target>1.7</maven.compiler.target>

       

          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        </properties>

       

        <dependencyManagement>

          <dependencies>

            <dependency>

              <groupId>com.google.gwt</groupId>

              <artifactId>gwt</artifactId>

              <version>${gwtVersion}</version>

              <type>pom</type>

              <scope>import</scope>

            </dependency>

          </dependencies>

        </dependencyManagement>

       

        <dependencies>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-servlet</artifactId>

            <scope>runtime</scope>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-user</artifactId>

            <scope>provided</scope>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-dev</artifactId>

            <scope>provided</scope>

          </dependency>

          <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.11</version>

            <scope>test</scope>

          </dependency>

          <dependency>

        <groupId>com.github.gwtbootstrap</groupId>

        <artifactId>gwt-bootstrap</artifactId>

        <version>2.3.2.0</version>

         </dependency>

        

         <!-- Errai Dependencies -->

         <dependency>

           <groupId>org.jboss.errai</groupId>

           <artifactId>errai-bus</artifactId>

           <version>3.1.1.Final</version>

         </dependency>

         <dependency>

        <groupId>org.jboss.errai</groupId>

        <artifactId>errai-config</artifactId>

        <version>3.1.1.Final</version>

         </dependency>

         <dependency>

        <groupId>org.jboss.errai</groupId>

        <artifactId>errai-ioc</artifactId>

        <version>3.1.1.Final</version>

         </dependency>

          

       

        </dependencies>

       

       

        <build>

          <!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode -->

          <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>

       

          <plugins>

       

            <!-- GWT Maven Plugin -->

            <plugin>

              <groupId>org.codehaus.mojo</groupId>

              <artifactId>gwt-maven-plugin</artifactId>

              <version>2.7.0</version>

              <executions>

                <execution>

                  <goals>

                    <goal>compile</goal>

                    <goal>test</goal>

                    <!--  <goal>generateAsync</goal>-->

                  </goals>

                </execution>

              </executions>

              <!-- Plugin configuration. There are many available options, see

                gwt-maven-plugin documentation at codehaus.org -->

              <configuration>

              <logLevel>INFO</logLevel>

                <runTarget>Queue.html</runTarget>

                <modules>

                  <module>gov.lanl.queue.Queue</module>

                  <module>gov.lanl.queue.client.mvp.MVP</module>

                </modules>

                <hostedWebapp>src/main/webapp</hostedWebapp>

              </configuration>

            </plugin>

            <plugin>

              <artifactId>maven-clean-plugin</artifactId>

              <version>2.6.1</version>

              <configuration>

               <filesets>

                 <fileset>

                  <directory>${basedir}</directory>

                  <includes>

                    <include>src/main/webapp/Queue</include>

                    <include>src/main/webapp/gov.lanl.queue.client.mvp.MVP</include>

                    <include>**/gwt-unitCache/**</include>

                    <include>.errai/</include>

                    </includes>

                 

                 </fileset>

               </filesets>

              </configuration>

             

            </plugin>

          </plugins>

        </build>

       

        <profiles>

          <profile>

            <id>jboss7</id>

            <activation>

              <activeByDefault>false</activeByDefault>

            </activation>

              <build>

               <plugins>

                 <plugin>

                   <artifactId>maven-war-plugin</artifactId>

                   <version>2.2</version>

                   <configuration>

                     <packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>

                     <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>

                   </configuration>

                 </plugin>

               </plugins>

              </build>

            <dependencies>

              <dependency>

                <groupId>org.jboss.errai</groupId>

                <artifactId>errai-jboss-as-support</artifactId>

                <version>3.1.1.Final</version>

              </dependency>

            </dependencies>   

          </profile>

       

       

       

        </profiles>

       

      </project>

        • 1. Re: Maven with errai and jboss compiling and packaging
          Divya Dadlani Newbie

          Hello Rico,

           

          For GWT 2.7, If you are trying to run or debug your application, you can simply run the command " mvn clean gwt:run " from the directory in which your pom is located, and it should launch Super Dev Mode for you. For this to work, you have to add a property to your pom file: 'errai.jboss.home' , which points to the directory of your JBoss installation.

           

          To deploy your app, you can run " mvn clean install " and copy the .war file to your JBoss deployments directory.


          You can find more information about running your app in Super Dev Mode at this link: Errai Reference Guide (note: classic Dev Mode is no longer available in GWT from version 2.7 onward. Also, in 2.7, running "gwt:run"starts both Super Dev Mode and the code server). If you need help configuring your pom correctly for any other purpose you can look at the Errai Tutorial sample application: errai/errai-tutorial · GitHub, or use Errai's Forge addon to automatically configure your pom for you. Instructions for the Forge addon are available here: errai/SHELL.asciidoc at master · errai/errai · GitHub (the versions are a bit outdated but all the instructions are the same).

           

          Let me know if you need any more help with using Errai.

           

          Cheers,
          Divya.