<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">
<!-- 
   Copyright 2014,2015,2016 the original author or authors. All rights reserved.
   site: http://www.ganshane.com
-->

  <parent>
    <groupId>com.ganshane.stark</groupId>
    <artifactId>stark-project_2.11</artifactId>
    <version>0.1.3</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>stark-rpc_2.11</artifactId>
  <packaging>jar</packaging>
  <name>Stark RPC Framework</name>
  <dependencies>
    <dependency>
      <groupId>com.ganshane.stark</groupId>
      <artifactId>stark-utils_${scala-binary-version}</artifactId>
    </dependency>
    <!-- netty -->
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty</artifactId>
    </dependency>
    <!-- zk support -->
    <dependency>
      <groupId>org.apache.curator</groupId>
      <artifactId>curator-framework</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- snappy -->
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>1.1.1.7</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tapestry</groupId>
      <artifactId>tapestry-json</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.tapestry</groupId>
      <artifactId>tapestry-ioc</artifactId>
      <version>${tapestry-release-version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.testng</groupId>
          <artifactId>testng</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>compile-protoc</id>
            <phase>generate-sources</phase>
            <configuration>
              <tasks>
                <mkdir dir="target/generated-sources" />
                <path id="proto.path">
                  <fileset dir="src/main/proto">
                    <include name="**/*.proto" />
                  </fileset>
                </path>
                <pathconvert pathsep=" " property="proto.files" refid="proto.path" />
                <exec executable="protoc">
                  <arg value="--java_out=target/generated-sources" />
                  <arg value="-I${project.basedir}/src/main/proto" />
                  <arg line="${proto.files}" />
                </exec>
              </tasks>
              <sourceRoot>target/generated-sources</sourceRoot>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
