<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.eclipse.sensinact.gateway.distribution</groupId>
    <artifactId>distribution</artifactId>
    <version>0.0.2-SNAPSHOT</version>
  </parent>
  <groupId>org.eclipse.sensinact.gateway.distribution</groupId>
  <artifactId>assembly</artifactId>
  <version>0.0.2-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Eclipse sensiNact Gateway assembly</name>
  <description>This project creates a zip containing a launchable sensiNact gateway</description>
  <licenses>
    <license>
      <name>EPL 2.0</name>
      <url>http://www.eclipse.org/legal/epl-2.0</url>
      <distribution>repo</distribution>
      <comments>Except for 3rd party content and examples.</comments>
    </license>
  </licenses>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-launcher</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution</groupId>
                  <artifactId>launcher</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>jar</type>
                  <classifier>export</classifier>
                  <outputDirectory>${project.build.outputDirectory}/launch</outputDirectory>
                  <destFileName>launcher.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>copy-feature-repositories</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/repository</outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>core-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>gogo-shell-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>jakarta-servlet-whiteboard-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>jakarta-rest-whiteboard-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-rest-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-websocket-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-ogc-sensorthings-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-ogc-sensorthings-mqtt-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-oidc-authenticator-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>virtual-temperature-sensor-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>zip</type>
                  <classifier>osgifeaturerepo</classifier>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>copy-features</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/features</outputDirectory>
              <artifactItems>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>core-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>core-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>gogo-shell-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>gogo-shell-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>jakarta-servlet-whiteboard-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>jakarta-servlet-whiteboard-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>jakarta-rest-whiteboard-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>jakarta-rest-whiteboard-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-rest-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>northbound-rest-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-websocket-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>northbound-websocket-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-ogc-sensorthings-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>northbound-ogc-sensorthings-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>northbound-ogc-sensorthings-mqtt-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>northbound-ogc-sensorthings-mqtt-feature.json</destFileName>
                </artifactItem>
                <artifactItem>
                  <groupId>org.eclipse.sensinact.gateway.distribution.features</groupId>
                  <artifactId>virtual-temperature-sensor-feature</artifactId>
                  <version>${revision}${changelist}</version>
                  <type>json</type>
                  <classifier>osgifeature</classifier>
                  <destFileName>virtual-temperature-sensor-feature.json</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>create-zip</id>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <zip basedir="${project.build.outputDirectory}" destfile="${project.build.directory}/gateway.zip" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifact</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/gateway.zip</file>
                  <type>zip</type>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>