My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
UsingGwtBinding  
This document presents how to use gwt-binding plugin
Updated Mar 15, 2009 by wmly...@gmail.com

Example

For working example see gwt-beans-example project in source repository.

Setting up Gwt-Beans

In order to use gwt-beans in your project first you need to add reposiories to your pom.xml file:

<repositories>
  <repository>
    <id>gwt-beans</id>
    <url>http://gwt-beans.googlecode.com/svn/mavenrepo</url>
  </repository>
</repositories>
<pluginRepositories>
  <pluginRepository>
    <id>gwt-beans</id>
    <url>http://gwt-beans.googlecode.com/svn/mavenrepo</url>
  </pluginRepository>
</pluginRepositories>

Add the dependency:

<dependencies>
  <dependency>
    <groupId>com.googlecode.wmlynar</groupId>
    <artifactId>gwt-beans-core</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>  

Include the module in application .gwt.xml

<inherits name="com.googlecode.wmlynar.gwtbeans.GwtBeans" />

And add gwt-beans plugin to your build:

<build>
  <plugins>
    <plugin>
      <groupId>com.googlecode.wmlynar</groupId>
      <artifactId>gwt-beans-maven-plugin</artifactId>
      <version>1.0-SNAPSHOT</version>
      <executions>
        <execution>
          <goals>
            <goal>generate</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <configFile>${basedir}/src/main/conf/bean-mappings.xml</configFile>
        <className>BindingFactory</className>
        <packageName>com.googlecode.wmlynar.gwtbeans.example.client</packageName>
      </configuration>
    </plugin>
  </plugins>
</build>

The last step allows for code generation.

In this example the mappings xml configuration file is located in ${basedir}/src/main/conf/bean-mappings.xml directory and generated class name will be com.googlecode.wmlynar.gwtbeans.example.client.BindingFactory. You need to replace those with the names suited for your project.

And that is all. When you type

mvn generate-sources

The plugin will analyse the source code of your project and generate binding factory class in the place you specified.

Powered by Google Project Hosting