<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>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
  <groupId>com.sencha.gxt</groupId>
  <artifactId>uibinder-bridge</artifactId>
  <version>2.4.0</version>
  <name>UiBinder Parser Registration</name>
  <properties>
    <!-- should be ${project.version} so this can have the same vers as gwt-user, etc -->
  	<gwt.version>2.4.0</gwt.version>
  	<java.version>1.6</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sources.gwt>${project.build.directory}/gwt-user</sources.gwt>
    <sources.generated>${project.build.directory}/generated-sources</sources.generated>
    <script.directory>${pom.basedir}/src/main/script</script.directory>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.google.gwt</groupId>
                  <artifactId>gwt-user</artifactId>
                  <version>${gwt.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${sources.gwt}</outputDirectory>
                  <includes>com/google/gwt/uibinder/**/*</includes>
                  <excludes>**/*.class</excludes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.groovy.maven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>applyUiBinderPatch</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${script.directory}/applyUiBinderPatch.groovy</source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
          <id>add-source</id>
          <phase>generate-sources</phase>
          <goals>
            <goal>add-source</goal>
          </goals>
          <configuration>
            <sources>
              <source>${sources.generated}</source>
            </sources>
          </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <links>
            <link>http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/</link>
          </links>
          <show>public</show>
          <quiet>true</quiet>
          <excludePackageNames>*.test.*:*.rebind.*</excludePackageNames>
        </configuration>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${sources.generated}</directory>
      </resource>
    </resources>
  </build>

  <scm>
    <connection>scm:svn:http://svn.sonatype.org/spice/tags/2.4.0</connection>
    <developerConnection>scm:svn:https://svn.sonatype.org/spice/tags/2.4.0</developerConnection>
    <url>http://svn.sonatype.org/spice/tags/2.4.0</url>
  </scm>
</project>
