<!-- #%L
  Gravia :: Container :: Tomcat :: Webapp
  %%
  Copyright (C) 2010 - 2014 JBoss by Red Hat
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L% -->

<!-- Set these VM properties in your IDE debugger -->
<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.jboss.gravia</groupId>
        <artifactId>gravia-container-tomcat</artifactId>
        <version>1.1.0.Beta20</version>
    </parent>

    <artifactId>gravia-container-tomcat-webapp</artifactId>
    <packaging>war</packaging>

    <name>Gravia :: Container :: Tomcat :: Webapp</name>

    <dependencies>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-container-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-container-tomcat-support</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-runtime-embedded</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.bridge</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.proxy</artifactId>
        </dependency>

        <!-- Provided Depdendencies -->
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-resource</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-provision</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-repository</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-resolver</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-runtime-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/components</outputDirectory>
                            <overWrite>true</overWrite>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.gravia</groupId>
                                    <artifactId>gravia-provision</artifactId>
                                    <version>${project.version}</version>
                                    <includes>OSGI-INF/org.jboss.gravia.**</includes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jboss.gravia</groupId>
                                    <artifactId>gravia-resolver</artifactId>
                                    <version>${project.version}</version>
                                    <includes>OSGI-INF/org.jboss.gravia.**</includes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jboss.gravia</groupId>
                                    <artifactId>gravia-repository</artifactId>
                                    <version>${project.version}</version>
                                    <includes>OSGI-INF/org.jboss.gravia.**</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Gravia-Identity>${project.artifactId};version=${project.version}</Gravia-Identity>
                            <Service-Component>OSGI-INF/org.jboss.gravia.provision.internal.ProvisionerService.xml,OSGI-INF/org.jboss.gravia.repository.internal.RepositoryMBeanService.xml,OSGI-INF/org.jboss.gravia.repository.internal.RepositoryService.xml,OSGI-INF/org.jboss.gravia.resolver.internal.ResolverService.xml</Service-Component>
                        </manifestEntries>
                    </archive>
                    <webResources>
                        <resource>
                            <directory>${project.build.directory}/components</directory>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
