<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2011-2014 The original author or authors
  ~
  ~  All rights reserved. This program and the accompanying materials
  ~  are made available under the terms of the Eclipse Public License v1.0
  ~  and Apache License v2.0 which accompanies this distribution.
  ~
  ~      The Eclipse Public License is available at
  ~      http://www.eclipse.org/legal/epl-v10.html
  ~
  ~      The Apache License v2.0 is available at
  ~      http://www.opensource.org/licenses/apache2.0.php
  ~
  ~  You may elect to redistribute this code under either of these licenses.
  -->

<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>io.vertx</groupId>
    <artifactId>vertx-parent</artifactId>
    <version>19</version>
  </parent>

  <groupId>com.julienviet</groupId>
  <artifactId>childprocess-vertx-ext</artifactId>
  <version>2.0.0</version>

  <name>Child Process extension for Vert.x</name>
  <url>https://github.com/vietj/vertx-childprocess</url>
  <description>Spawn child processes from Vert.x</description>

  <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>

  <scm>
    <connection>scm:git:git@github.com:vietj/childprocess-vertx-ext.git</connection>
    <developerConnection>scm:git:git@github.com:vietj/childprocess-vertx-ext.git</developerConnection>
    <url>git@github.com:vietj/childprocess-vertx-ext.git</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Snapshots Repository</name>
      <url>${sonatype.snapshotRepository}</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Release Repository</name>
      <url>${sonatype.releaseRepository}</url>
    </repository>
  </distributionManagement>

  <developers>
    <developer>
      <name>Julien Viet</name>
      <email>julien@julienviet.com</email>
    </developer>
  </developers>

  <properties>
    <stack.version>4.4.4</stack.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <generated.dir>${project.basedir}/src/main/generated</generated.dir>
    <docs.dir>${project.basedir}/src/main/docs</docs.dir>
    <sonatype.releaseRepository>https://oss.sonatype.org/service/local/staging/deploy/maven2/</sonatype.releaseRepository>
    <sonatype.snapshotRepository>https://oss.sonatype.org/content/repositories/snapshots/</sonatype.snapshotRepository>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dependencies</artifactId>
        <version>${stack.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>nuprocess</artifactId>
      <version>2.0.6</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
      <version>4.11</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <executions>
            <execution>
              <id>default-clean</id>
              <configuration>
                <filesets>
                  <fileset>
                    <directory>${generated.dir}</directory>
                  </fileset>
                </filesets>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
            <execution>
              <id>default-compile</id>
              <configuration>
                <annotationProcessors>
                  <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                  <annotationProcessor>io.vertx.docgen.JavaDocGenProcessor</annotationProcessor>
                  <annotationProcessor>io.vertx.docgen.DocGenProcessor</annotationProcessor>
                </annotationProcessors>
                <compilerArgs>
                  <arg>-Acodegen.output=${project.basedir}/src/main</arg>
                  <arg>-Adocgen.source=${docs.dir}/*.md</arg>
                  <arg>-Adocgen.output=${project.basedir}/jekyll/guide/$lang</arg>
                  <arg>-Adocgen.syntax=markdown</arg>
                  <arg>-Amaven.groupId=${project.groupId}</arg>
                  <arg>-Amaven.artifactId=${project.artifactId}</arg>
                  <arg>-Amaven.version=${project.version}</arg>
                </compilerArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${generated.dir}</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.basedir}/src/benchmark/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.21.0</version>
        <executions>
          <execution>
            <id>env-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
              <includes>
                <include>io/reactiverse/pgclient/it/EnvTest.java</include>
              </includes>
              <environmentVariables>
                <PGHOSTADDR>test_host</PGHOSTADDR>
                <PGDATABASE>test_database</PGDATABASE>
                <PGPORT>1234</PGPORT>
                <PGUSER>test_user</PGUSER>
                <PGPASSWORD>test_password</PGPASSWORD>
              </environmentVariables>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <sourcepath>${project.build.sourceDirectory};${project.build.directory}/generated-sources/annotations</sourcepath>
          <sourceFileIncludes>
            <sourceFileInclude>com/julienviet/**/*.java</sourceFileInclude>
          </sourceFileIncludes>
          <sourceFileExcludes>
            <sourceFileExclude>com/julienviet/groovy/**/*.java</sourceFileExclude>
            <sourceFileExclude>**/package-info.java</sourceFileExclude>
            <sourceFileExclude>**/impl/**</sourceFileExclude>
          </sourceFileExcludes>
          <detectLinks />
          <detectJavaApiLink />
          <links>
            <link>http://vertx.io/docs/apidocs/</link>
          </links>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>package-sources</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <attach>true</attach>
              <archive>
                <!-- Need a manifest to avoid empty archive -->
                <manifest>
                </manifest>
              </archive>
              <descriptors>
                <descriptor>src/assembly/sources.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Site gen -->
    <profile>
      <id>site-gen</id>
      <activation>
        <property>
          <name>!skipSite</name>
        </property>
      </activation>
      <pluginRepositories>
        <pluginRepository>
          <id>rubygems-releases</id>
          <url>http://rubygems-proxy.torquebox.org/releases</url>
        </pluginRepository>
      </pluginRepositories>
      <repositories>
        <repository>
          <id>rubygems-releases</id>
          <url>http://rubygems-proxy.torquebox.org/releases</url>
        </repository>
      </repositories>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.4</version>
            <configuration>
              <skip>true</skip>
              <skipDeploy>true</skipDeploy>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <phase>site</phase>
                <configuration>
                  <skip>false</skip>
                  <reportOutputDirectory>${project.basedir}/jekyll</reportOutputDirectory>
                </configuration>
                <goals>
                  <goal>javadoc</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
