<!--
  ~ 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>2.6.3</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

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

    <repositories>
        <repository>
            <id>jboss</id>
            <url>http://repository.jboss.org/maven2/</url>
        </repository>
    </repositories>


    <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/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>
                                <Import-Package>
                                    !junit.framework,
                                    !org.junit,
                                    !org.mockito,
                                    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,
                                    *
                                </Import-Package>
                                <!--<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>-->
                            </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-hibernate</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-cloud</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>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>${maven.antrun.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>all-javadoc</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <javadoc destdir="target/apidocs" author="true" version="true" use="true"
                                                 windowtitle="Hazelcast API">
                                            <fileset dir="../hazelcast/src/main/java/" defaultexcludes="true">
                                                <include name="**/nio/DataSerializable*"/>
                                                <include name="**/core/**"/>
                                                <include name="**/monitor/**"/>
                                                <include name="**/merge/**"/>
                                                <include name="**/config/**"/>
                                                <include name="**/jmx/**"/>
                                                <include name="**/query/**"/>
                                                <include name="**/partition/**"/>
                                                <exclude name="**/*.html"/>
                                            </fileset>
                                            <fileset dir="../hazelcast-client/src/main/java/" defaultexcludes="true">
                                                <include name="**/HazelcastClient.java"/>
                                                <exclude name="**/*.html"/>
                                            </fileset>
                                            <fileset dir="../hazelcast-spring/src/main/java/" defaultexcludes="true">
                                                <include name="**/*.java"/>
                                                <exclude name="**/*.html"/>
                                            </fileset>
                                            <doctitle>
                                                <![CDATA[<h1>Hazelcast</h1>]]>
                                            </doctitle>
                                            <bottom>
                                                <![CDATA[<i>Copyright &#2.0; 2008-2011 Hazel Ltd. All Rights Reserved.</i>]]></bottom>
                                            <link href="http://download.oracle.com/javase/1.5.0/docs/api/"/>
                                            <link href="http://java.sun.com/products/servlet/2.3/javadoc/"/>
                                        </javadoc>
                                        <jar jarfile="target/hazelcast-all-${project.parent.version}-javadoc.jar">
                                            <fileset dir="target/apidocs"/>
                                        </jar>
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!--<dependencies>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast-client</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast-hibernate</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast-spring</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast-cloud</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.hazelcast</groupId>-->
            <!--<artifactId>hazelcast-wm</artifactId>-->
            <!--<version>${project.parent.version}</version>-->
            <!--<scope>provided</scope>-->
        <!--</dependency>-->
    <!--</dependencies>-->

</project>
