<?xml version="1.0" encoding="UTF-8"?>
<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>org.cometd</groupId>
    <artifactId>cometd-project</artifactId>
    <version>8.0.12</version>
  </parent>
  <artifactId>cometd-distribution</artifactId>
  <packaging>pom</packaging>
  <name>CometD :: Distribution</name>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <finalName>cometd-${project.version}</finalName>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>release</id>
                <goals>
                  <goal>single</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <overrideUid>0</overrideUid>
                  <overrideGid>0</overrideGid>
                  <descriptors>
                    <descriptor>src/main/assembly/distribution.xml</descriptor>
                  </descriptors>
                  <tarLongFileMode>posix</tarLongFileMode>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>release</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <executable>${project.build.scriptSourceDirectory}/release.sh</executable>
                  <arguments>
                    <argument>${project.basedir}/..</argument>
                    <argument>${project.version}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
