<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">
  <parent>
    <artifactId>crash.parent</artifactId>
    <groupId>org.crashub</groupId>
    <version>1.3.0-beta3</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>crash.distrib</artifactId>
  <packaging>jar</packaging>
  <version>1.3.0-beta3</version>

  <name>CRaSH Distrib</name>
  <description>The CRaSH distribution</description>

  <dependencies>

    <!-- Standalone -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.packaging</artifactId>
      <type>tar.gz</type>
    </dependency>

    <!-- War -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.packaging</artifactId>
      <type>war</type>
    </dependency>

    <!-- GateIn war -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.jcr.exo</artifactId>
      <type>war</type>
    </dependency>

    <!-- Spring war -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.packaging</artifactId>
      <type>war</type>
      <classifier>spring</classifier>
    </dependency>

    <!-- Mule application -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.packaging</artifactId>
      <type>zip</type>
      <classifier>mule-app</classifier>
    </dependency>

    <!-- Mail plugin -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.mail</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
    </dependency>

    <!-- Sources -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.cli</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.shell</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.telnet</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.ssh</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.embed.spring</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.jcr.core</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.jcr.exo</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.jcr.jackrabbit</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.plugins.crowd</artifactId>
      <classifier>sources</classifier>
    </dependency>

    <!-- Doc -->
<!--
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.doc.reference</artifactId>
      <type>pdf</type>
    </dependency>
-->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.doc.reference</artifactId>
      <classifier>html</classifier>
      <type>zip</type>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.doc.reference</artifactId>
      <classifier>javadoc</classifier>
    </dependency>
<!--
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.doc.cookbook</artifactId>
      <type>pdf</type>
    </dependency>
-->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.doc.cookbook</artifactId>
      <classifier>html</classifier>
      <type>zip</type>
    </dependency>

  </dependencies>

  <build>
    <finalName>crash-${project.version}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-docs</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/docs.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>make-war</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/war.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>make-spring</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/spring.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>make-mule-app</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/mule-app.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>make-gatein</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/gatein.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>upload</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode.maven-gcu-plugin</groupId>
            <artifactId>maven-gcu-plugin</artifactId>
            <executions>
              <execution>
                <phase>install</phase>
                <goals>
                  <goal>upload</goal>
                </goals>
                <configuration>
                  <serverId>googlecode</serverId>
                  <failsOnError>true</failsOnError>
                  <projectName>crsh</projectName>
                  <uploads>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}-gatein.tar.gz</file>
                      <summary>CRaSH GateIn web archive ${project.version}</summary>
                      <labels>
                        <label>GateIn</label>
                      </labels>
                    </upload>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}-mule-app.tar.gz</file>
                      <summary>CRaSH Mule application ${project.version}</summary>
                      <labels>
                        <label>Mule</label>
                      </labels>
                    </upload>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}-spring.tar.gz</file>
                      <summary>CRaSH Spring web archive ${project.version}</summary>
                      <labels>
                        <label>Spring</label>
                      </labels>
                    </upload>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}-war.tar.gz</file>
                      <summary>CRaSH Standalone web archive ${project.version}</summary>
                      <labels>
                        <label>Servlet</label>
                      </labels>
                    </upload>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}-docs.tar.gz</file>
                      <summary>CRaSH Documentation and sources bundle ${project.version}</summary>
                      <labels>
                        <label>Documentation</label>
                      </labels>
                    </upload>
                    <upload>
                      <file>${project.build.directory}/crash-${project.version}.tar.gz</file>
                      <summary>CRaSH Standalone ${project.version}</summary>
                      <labels>
                        <label>Standalone</label>
                      </labels>
                    </upload>
                  </uploads>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>