<?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>com.zybnet</groupId>
  <artifactId>vaadin-autocomplete</artifactId>
  <packaging>jar</packaging>
  <version>1.1.0</version>
  <name>AutocompleteField for Vaadin</name>
  <description>Autocomplete addon for Vaadin</description>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
  <scm>
    <connection>scm:git:git@github.com:RaffaeleSgarro/vaadin-autocomplete.git</connection>
    <developerConnection>scm:git:git@github.com:RaffaeleSgarro/vaadin-autocomplete.git</developerConnection>
    <url>git@github.com:RaffaeleSgarro/vaadin-autocomplete.git</url>
  </scm>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <vaadin.version>7.2.4</vaadin.version>
    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-server</artifactId>
      <version>${vaadin.version}</version>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-client-compiled</artifactId>
      <version>${vaadin.version}</version>
    </dependency>
    <!--
      Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
      
      For widgetset compilation, vaadin-client-compiler is automatically added on the
      compilation classpath by vaadin-maven-plugin so normally there is no need for an
      explicit dependency.
    -->
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-client-compiler</artifactId>
      <version>${vaadin.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-client</artifactId>
      <version>${vaadin.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-push</artifactId>
      <version>${vaadin.version}</version>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-themes</artifactId>
      <version>${vaadin.version}</version>
    </dependency>
  </dependencies>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>com/zybnet/autocomplete/client/*.java</include>
          <include>com/zybnet/autocomplete/shared/*.java</include>
          <include>**/*.gwt.xml</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <excludes>
            <exclude>com/zybnet/autocomplete/client/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Vaadin-Package-Version>1</Vaadin-Package-Version>
              <Implementation-Title>${project.name}</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Vaadin-Widgetsets>com.zybnet.autocomplete.AutocompleteWidgetSet</Vaadin-Widgetsets>
            </manifestEntries>
          </archive>
          <excludes>
            <exclude>app/</exclude>
          </excludes>
        </configuration>
      </plugin>
      <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
      <!-- directory is cleaned properly -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/main/webapp/VAADIN/widgetsets</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>7.2.4</version>
        <configuration>
          <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
          <!-- <runTarget>mobilemail</runTarget> -->
          <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
            way compatible with Vaadin eclipse plugin. -->
          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
          </webappDirectory>
          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
          </hostedWebapp>
          <!-- Most Vaadin apps don't need this stuff, guide that to target -->
          <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
          <deploy>${project.build.directory}/gwt-deploy</deploy>
          <!-- Compile report is not typically needed either, saves hunreds of mb disk -->
          <compileReport>false</compileReport>
          <noServer>true</noServer>
          <!-- Remove draftCompile when project is ready -->
          <draftCompile>false</draftCompile>
          <style>OBF</style>
          <strict>true</strict>
          <runTarget>http://localhost:8080/</runTarget>
        </configuration>
        <executions>
          <execution>
            <configuration>
              <!-- if you don't specify any modules, the plugin will find them -->
              <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> 
                </modules> -->
            </configuration>
            <goals>
              <goal>clean</goal>
              <goal>resources</goal>
              <goal>update-theme</goal>
              <goal>update-widgetset</goal>
              <goal>compile-theme</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.2.1.v20140609</version>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.2</version>
        <extensions>true</extensions>
        <configuration>
           <serverId>ossrh</serverId>
           <nexusUrl>https://oss.sonatype.org/</nexusUrl>
           <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.vaadin</groupId>
                    <artifactId>
                      vaadin-maven-plugin
                    </artifactId>
                    <versionRange>
                      ${vaadin.version}
                    </versionRange>
                    <goals>
                      <goal>resources</goal>
                      <goal>update-widgetset</goal>
                      <goal>compile</goal>
                      <goal>update-theme</goal>
                      <goal>compile-theme</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-eclipse-plugin</artifactId>
          <configuration>
            <wtpversion>2.0</wtpversion>
            <additionalProjectnatures>
              <projectnature>com.vaadin.integration.eclipse.widgetsetNature</projectnature>
            </additionalProjectnatures>
            <additionalBuildcommands>
              <buildcommand>com.vaadin.integration.eclipse.widgetsetBuilder</buildcommand>
              <buildcommand>com.vaadin.integration.eclipse.addonStylesBuilder</buildcommand>
            </additionalBuildcommands>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <!-- To relase to OSSRH we need source and javadoc as well, and everything must be signed with GPG -->
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
