<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>no.rmz</groupId>
    <artifactId>blobee</artifactId>
    <packaging>jar</packaging>
    <version>0.1</version>
    <name>Blobee</name>
    <url>https://github.com/la3lma/blobee</url>
    <description>
        An transport mechanism for the RPC interfaces
        that are defined in the open source version
        of Google's protobuffer library.
    </description>

    <scm>
        <connection>scm:git:git@github.com:la3lma/blobee.git/tags/blobee-0.1</connection>
        <url>https://github.com/la3lma/blobee/tags/blobee-0.1</url>
    </scm>

    <developers>
        <developer>
            <id>rmz</id>
            <name>Bjorn Remseth</name>
            <email>la3lma@gmail.com</email>
            <url>http://rmzlablog.blobspot.no/</url>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>

        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <guice.version>3.0</guice.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jetty.version>8.0.0.M2</jetty.version>
        <compileSource>1.7</compileSource>
        <compileTarget>1.7</compileTarget>
        <mockito.version>1.9.5-rc1</mockito.version>
        <findbugs.version>1.3.2</findbugs.version>
        <junit.version>4.11</junit.version>
        <guava.version>13.0.1</guava.version>
        <netty.version>3.6.2.Final</netty.version>
        <protobuf.version>2.3.0</protobuf.version>
    </properties>


    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>${netty.version}</version>
        </dependency>


        <dependency>
            <groupId>no.rmz</groupId>
            <artifactId>blobeeprototest</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <dependency>
            <groupId>net.sourceforge.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <version>${findbugs.version}</version>
        </dependency>
    </dependencies>


    <!-- Profiles used to determine which protoc
         compiler binary we need to use -->
    <profiles>
        <profile>
            <id>profile-protoc-mac-x86_64</id>
            <activation>
                <os>
                    <family>mac</family>
                    <name>mac os x</name>
                    <arch>x86_64</arch>
                </os>
            </activation>
            <properties>
                <protoc.executable>bin/protoc-mac_os_x-x86_64</protoc.executable>
            </properties>
        </profile>

        <profile>
            <id>profile-protoc-linux-x86</id>
            <activation>
                <os>
                    <family>unix</family>
                    <name>linux</name>
                </os>
            </activation>
            <properties>
                <protoc.executable>bin/protoc-linux-i386</protoc.executable>
            </properties>
        </profile>
        <profile>
            <id>profile-protoc-win32</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <protoc.executable>bin/protoc-${protobuf.version}-win32.exe</protoc.executable>
            </properties>
        </profile>

    </profiles>


    <build>
        <plugins>


	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-release-plugin</artifactId>
	    <version>2.4</version>
            <configuration>
                <mavenExecutorId>forked-path</mavenExecutorId>
            </configuration>
	    <executions>
	      <execution>
		<id>default</id>
		<goals>
		  <goal>perform</goal>
		</goals>
		<configuration>
		  <pomFileName>blobee/pom.xml</pomFileName>
		  </configuration>
		</execution>
	      </executions>
	    </plugin>


           <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <configuration>
                        <tasks>
                            <mkdir dir="${project.build.directory}/generated-sources" />
                            <exec executable="${basedir}/${protoc.executable}">
                                <arg value="--java_out=${project.build.directory}/generated-sources" />
                                <arg value="--proto_path=${basedir}/src/main/protobuf" />
                                <arg value="${basedir}/src/main/protobuf/rpc.proto" />
                            </exec>
                        </tasks>
                        <sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>${project.build.directory}/generated-sources</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>



        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.4</version>

            <configuration>
                <source>${compileSource}</source>
                <target>${compileTarget}</target>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <index>true</index>
                    <manifest>
                        <classpathPrefix>lib/</classpathPrefix>
                        <addClasspath>true</addClasspath>
                        <mainClass>no.rmz.App</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        <overWriteReleases>true</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                    </configuration>
                </execution>
            </executions>
        </plugin>



        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <instrumentation>
                    <ignores>
                        <ignore>com.example.boringcode.*</ignore>
                    </ignores>
                    <excludes>
                        <exclude>no/rmz/rmatch/**/*Test.class</exclude>
                    </excludes>
                </instrumentation>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        </plugins>
    </build>


    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <configLocation>config/sun_checks.xml</configLocation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
