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

  <name>CRaSH Packaging</name>
  <description>The CRaSH packaging module</description>

  <properties>
    <foobar>juu</foobar>
  </properties>

  <dependencies>

    <!-- Cmdline standalone -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.cli</artifactId>
    </dependency>

    <!-- Core -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.shell</artifactId>
    </dependency>
    <dependency>
      <groupId>jline</groupId>
      <artifactId>jline</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.ivy</groupId>
      <artifactId>ivy</artifactId>
    </dependency>

    <!-- Standalone dependencies-->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.telnet</artifactId>
      <classifier>standalone</classifier>
    </dependency>
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.ssh</artifactId>
      <classifier>standalone</classifier>
    </dependency>

    <!-- SSHD connector dependencies -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.ssh</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.sshd</groupId>
      <artifactId>sshd-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.sshd</groupId>
      <artifactId>sshd-pam</artifactId>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk16</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.mina</groupId>
      <artifactId>mina-core</artifactId>
    </dependency>

    <!-- Telnet connector dependencies -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.connectors.telnet</artifactId>
    </dependency>
    <dependency>
      <groupId>net.wimpi</groupId>
      <artifactId>telnetd-x</artifactId>
    </dependency>

    <!-- Spring -->
    <dependency>
      <groupId>org.crashub</groupId>
      <artifactId>crash.embed.spring</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-asm</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>

  </dependencies>

  <build>
    <finalName>crsh-${project.version}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-war</id>
          </execution>
          <execution>
            <id>make-packaging</id>
          </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>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- Produce an executable jar file that embeds Tomcat : useful for testing war packaging works well -->
  <profiles>
    <profile>
      <id>tomcat</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec-war-only</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <warRunDependencies>
                    <warRunDependency>
                      <dependency>
                        <groupId>org.crashub</groupId>
                        <artifactId>crash.packaging</artifactId>
                        <version>${project.version}</version>
                        <type>war</type>
                      </dependency>
                      <contextPath>/</contextPath>
                    </warRunDependency>
                  </warRunDependencies>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
