<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>me.zwave</groupId>
  <artifactId>zway</artifactId>
  <packaging>jar</packaging>
  <version>4.1.1</version>
  <name>Z-Way library Java wrapper</name>
  <description>Java wrapper for Z-Wave.Me Z-Way library</description>
  <url>https://z-wave.me/z-way/api</url>
  
  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <organization>
    <name>Z-Wave.Me</name>
    <url>https://z-wave.me/</url>
  </organization>
  
  <scm>
    <connection>scm:git@github.com:Z-Wave-Me/Z-Way-JNI-Wrapper.git</connection>
    <url>https://github.com/Z-Wave-Me/Z-Way-JNI-Wrapper</url>
  </scm>
  
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Z-Wave-Me/Z-Way-JNI-Wrapper/issues</url>
  </issueManagement>
  
  <developers>
    <developer>
      <id>zme</id>
      <name>Z-Wave.Me</name>
    </developer>
  </developers>
  
  <properties>
    <zway.root>/opt/z-way-server</zway.root>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>
  
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  
  <build>
    <plugins>
      <!-- code autogeneration -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>autoclean_code</id>
            <phase>clean</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>python2</executable>
              <workingDirectory></workingDirectory>
              <arguments>
                <argument>src/main/scripts/autogenerate_code.py</argument>
                <argument>clean</argument>
                <argument>${zway.root}</argument>
                <argument>src/main/native/jni_zway_wrapper.c</argument>
                <argument>src/main/java/me/zwave/zway/ZWay.java</argument>
              </arguments>    
            </configuration>
          </execution>
          <execution>
            <id>autogenerate_code</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>python2</executable>
              <workingDirectory></workingDirectory>
              <arguments>
                <argument>src/main/scripts/autogenerate_code.py</argument>
                <argument>generate</argument>
                <argument>${zway.root}</argument>
                <argument>src/main/native/jni_zway_wrapper.c</argument>
                <argument>src/main/java/me/zwave/zway/ZWay.java</argument>
              </arguments>    
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- for maven central -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.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>3.2.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
    </plugins>
  </build>
  
  <!-- publish -->
  <profiles>
    <profile>
      <id>ci-cd</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing failed: Inappropriate ioctl for device -->
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
