<!--
  ~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
  ~
  ~ 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.
  -->

<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.hazelcast</groupId>
        <artifactId>hazelcast-root</artifactId>
        <version>3.2-RC2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <name>hazelcast-all</name>
    <artifactId>hazelcast-all</artifactId>
    <packaging>jar</packaging>

    <build>
        <resources>
            <!-- Include all class files, that should be part of hazelcast-all.jar and should get processed by bnd-tool  -->
            <resource><directory>../hazelcast/target/classes</directory></resource>
            <resource><directory>../hazelcast-client/target/classes</directory></resource>
            <resource><directory>../hazelcast-hibernate/hazelcast-hibernate3/target/classes</directory></resource>
            <resource><directory>../hazelcast-spring/target/classes</directory></resource>
            <resource><directory>../hazelcast-cloud/target/classes</directory></resource>
            <resource><directory>../hazelcast-wm/target/classes</directory></resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven.bundle.plugin.version}</version>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <instructions>
                                <Bundle-Activator>com.hazelcast.osgi.Activator</Bundle-Activator>
                                <Export-Package>
                                    com.hazelcast.*
                                </Export-Package>
                                <Import-Package>
                                    !sun.misc,
                                    !org.junit,
                                    org.apache.log4j;resolution:=optional,
                                    org.apache.log4j.*;resolution:=optional,
                                    org.slf4j;resolution:=optional,
                                    org.hibernate;resolution:=optional,
                                    org.hibernate.*;resolution:=optional,
                                    com.mongodb;resolution:=optional,
                                    com.mongodb.*;resolution:=optional,
                                    org.springframework;resolution:=optional,
                                    org.springframework.*;resolution:=optional,
                                    org.bson;resolution:=optional,
                                    org.bson.*;resolution:=optional,
                                    org.codehaus.groovy.jsr223;resolution:=optional,
                                    org.jruby.embed.jsr223;resolution:=optional,
                                    *
                                </Import-Package>
                            </instructions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.plugin.version}</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <compress>true</compress>
                        <manifest>
                            <mainClass>com.hazelcast.examples.TestApp</mainClass>
                            <addClasspath>false</addClasspath>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.dependency.plugin.version}</version>
                <executions>
                    <execution>
                        <id>unpack-sources</id>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/sources</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast-client</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast-cloud</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast-hibernate3</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast-spring</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.hazelcast</groupId>
                                    <artifactId>hazelcast-wm</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>${maven.assembly.plugin.version}</version>
                <executions>
                    <execution>
                        <id>source-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assemble/src.xml</descriptor>
                            </descriptors>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <appendAssemblyId>true</appendAssemblyId>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration combine.self="override"/>
            </plugin>
        </plugins>
    </build>

</project>
