<!--

    Copyright (C) 2010 FuseSource, Corp. All rights reserved.
    http://fusesource.com

    The software in this package is published under the terms of the AGPL license
    a copy of which has been included with this distribution in the license.txt file.

-->
<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>

  <parent>
    <groupId>com.fusesource.fmc</groupId>
    <artifactId>fmc-scala</artifactId>
    <version>0.9.8-beta</version>
    <relativePath>../fmc-scala</relativePath>
  </parent>

  <artifactId>fmc-webui</artifactId>
  <name>${project.artifactId}</name>
  <description>FuseSource :: Fuse Management Console Web Archive</description>
  <packaging>war</packaging>

  <properties>
    <fon.osgi.symbolic.name>com.fusesource.fmc.fmc-webui</fon.osgi.symbolic.name>
    <fon.osgi.export />
    <fon.osgi.import>
      *;resolution:=optional
    </fon.osgi.import>
    <fon.osgi.private.pkg>
      com.fusesource.fmc.webui*
    </fon.osgi.private.pkg>

    <webapp-outdir>${basedir}/target/fmc-webui-${project.version}</webapp-outdir>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.fusesource.insight</groupId>
      <artifactId>insight-log</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-core</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-groups</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-linkedin-zookeeper</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-zookeeper</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-boot-commands</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-monitor</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.fusesource.fabric</groupId>
      <artifactId>fabric-jaas</artifactId>
      <version>${fabric.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jclouds</groupId>
      <artifactId>jclouds-compute</artifactId>
      <version>${jclouds-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.enterprise</artifactId>
      <version>4.2.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.linkedin</groupId>
      <artifactId>org.linkedin.zookeeper-impl</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-server</artifactId>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-servlet</artifactId>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-json</artifactId>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-multipart</artifactId>
        <version>${jersey-version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>provided</scope>            
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>            
    </dependency>

    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>      
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-core-asl</artifactId>            
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-jaxrs</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-xc</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jettison</groupId>
      <artifactId>jettison</artifactId>
      <version>1.1</version>         
    </dependency>

    <dependency>
      <groupId>org.apache.karaf.admin</groupId>
      <artifactId>org.apache.karaf.admin.management</artifactId>
      <scope>provided</scope>            
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-api-version}</version>
      <scope>provided</scope>            
    </dependency>

	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-io</artifactId>
		<version>1.3.2</version>
	</dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.fusesource.scalate</groupId>
      <artifactId>scalate-test</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.fusesource.fmc</groupId>
      <artifactId>fmc-camel-facade</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fusesource.fmc</groupId>
      <artifactId>fmc-activemq-facade</artifactId>
      <version>${project.version}</version>           
    </dependency>

    <dependency>
    	<groupId>com.fusesource.fmc</groupId>
    	<artifactId>fmc-license</artifactId>
    	<version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <manifestLocation>${webapp-outdir}/META-INF</manifestLocation>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <excludeDependencies>${fon.osgi.exclude.dependencies}</excludeDependencies>
          <instructions>
            <Webapp-Context>/</Webapp-Context>
            <Web-ContextPath>/</Web-ContextPath>
            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>

            <Bundle-Name>${project.description}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Activator>${fon.osgi.activator}</Bundle-Activator>
            <Export-Package>${fon.osgi.export}</Export-Package>
            <Import-Package>${fon.osgi.import}</Import-Package>
            <DynamicImport-Package>${fon.osgi.dynamic}</DynamicImport-Package>
            <Private-Package>${fon.osgi.private.pkg}</Private-Package>
            <Implementation-Title>FuseSource FON</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
            <Include-Resource>${fon.osgi.resource}</Include-Resource>
            <_versionpolicy>${fon.osgi.import.default.version}</_versionpolicy>
          <_failok>${fon.osgi.failok}</_failok>
        <Export-Service>${fon.osgi.services.export}</Export-Service>
      </instructions>
    </configuration>
  </plugin>

  <plugin>
    <groupId>org.scala-tools</groupId>
    <artifactId>maven-scala-plugin</artifactId>
  </plugin>

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
      <execution>
        <goals>
          <goal>java</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <mainClass>com.fusesource.fmc.webui.IDERunner</mainClass>
      <classpathScope>test</classpathScope>
    </configuration>
  </plugin>

  <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>${jetty-plugin-version}</version>
    <configuration>
      <webAppConfig>
        <contextPath>/</contextPath>
        <resourceBase>${webapp-outdir}</resourceBase>
      </webAppConfig>

      <systemProperties>
        <!-- enable easy JMX connection to JConsole -->
        <systemProperty>
          <name>com.sun.management.jmxremote</name>
          <value />
        </systemProperty>
      </systemProperties>
      <scanIntervalSeconds>1</scanIntervalSeconds>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.enterprise</artifactId>
        <version>4.2.0</version>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>${osgi-version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.karaf.admin</groupId>
        <artifactId>org.apache.karaf.admin.management</artifactId>
        <version>${karaf-version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j-api-version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-core</artifactId>
        <version>${fabric.version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-groups</artifactId>
        <version>${fabric.version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-linkedin-zookeeper</artifactId>
        <version>${fabric.version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-zookeeper</artifactId>
        <version>${fabric.version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-monitor</artifactId>
        <version>${fabric.version}</version>
      </dependency>
      <dependency>
        <groupId>org.fusesource.fabric</groupId>
        <artifactId>fabric-jaas</artifactId>
        <version>${fabric.version}</version>
      </dependency>
    </dependencies>
  </plugin>

  <plugin>
    <groupId>org.fusesource.coffeebar</groupId>
    <artifactId>brew</artifactId>
    <version>${coffeebar-version}</version>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
          <goal>optimize</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <coffeeSourceDir>${basedir}/src/main/webapp</coffeeSourceDir>
      <coffeeOutputDir>${webapp-outdir}</coffeeOutputDir>

      <hamlSourceDir>${basedir}/src/main/webapp/app/views</hamlSourceDir>
      <hamlOutputDir>${webapp-outdir}/app/views</hamlOutputDir>

      <jadeSourceDir>${basedir}/src/main/webapp/app/views</jadeSourceDir>
      <jadeOutputDir>${webapp-outdir}/app/views</jadeOutputDir>

      <resourceSourceDir>${basedir}/src/main/webapp</resourceSourceDir>
      <resourceOutputDir>${webapp-outdir}</resourceOutputDir>

      <viewsMapOutputFile>${webapp-outdir}/app/views/jade.js</viewsMapOutputFile>

      <optimizeSourceDir>${webapp-outdir}/app</optimizeSourceDir>
      <optimizeBuildDir>${project.build.directory}/tmp</optimizeBuildDir>
      <optimizeOutputDir>${webapp-outdir}/app</optimizeOutputDir>

      <optimizedFileNameSuffix>false</optimizedFileNameSuffix>
      <cssOptimizer>standard.keepLines</cssOptimizer>
      <jsOptimizer>closure.keepLines</jsOptimizer>

    </configuration>
    <dependencies>
      <dependency>
        <groupId>com.google.javascript</groupId>
        <artifactId>closure-compiler</artifactId>
        <version>r1352</version>
      </dependency>
      <dependency>
        <groupId>args4j</groupId>
        <artifactId>args4j</artifactId>
        <version>2.0.12</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>r09</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>2.4.1</version>
      </dependency>
    </dependencies>

  </plugin>

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
      <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
      <warSourceDirectory>${webapp-outdir}</warSourceDirectory>
      <archive>
        <manifestFile>${webapp-outdir}/META-INF/MANIFEST.MF</manifestFile>
      </archive>                
    </configuration>
  </plugin>

</plugins>
  </build>
</project>
