<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>
    <artifactId>brooklyn-launcher</artifactId>
    <packaging>bundle</packaging>
    <name>Brooklyn Launcher</name>
    <description>
        This project contains a brooklyn.launcher.Main class
        for command-line invocation, and includes the 
        Brooklyn WAR in its JAR for classpath-based starting.
    </description>

    <parent>
        <groupId>io.brooklyn</groupId>
        <artifactId>brooklyn-parent</artifactId>
        <version>0.5.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <dependencies>
        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-rest</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-logback-xml</artifactId>
            <!-- optional so that this project has logging; dependencies may redeclare or supply their own -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.brooklyn</groupId>
            <artifactId>brooklyn-test-support</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.3.0</version>
        </dependency>

        <dependency>
          <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
          <artifactId>concurrentlinkedhashmap-lru</artifactId>
          <version>1.0_jdk5</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <!-- copy the WAR so it is available on the classpath for programmatic deployment -->
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <!-- this can fail in eclipse trying to copy _from_ target/classes.
                                         see http://jira.codehaus.org/browse/MDEP-259 -->
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>brooklyn-jsgui</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>target/classes</outputDirectory>
                                    <destFileName>brooklyn.war</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Include-Resource>{maven-resources}, target/classes/brooklyn.war</Include-Resource>
                        <Bundle-Activator>brooklyn.launcher.Activator</Bundle-Activator>
                        <Main-class>brooklyn.launcher.Main</Main-class>
                    </instructions>
                </configuration>
            </plugin>
            <plugin> 
                <artifactId>maven-site-plugin</artifactId> 
                <configuration> 
                    <generateReports>false</generateReports> 
                </configuration> 
            </plugin>
		</plugins>
	</build>
</project>
