<?xml version="1.0" encoding="UTF-8"?>
<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.composum.assets</groupId>
        <artifactId>composum-assets-commons</artifactId>
        <version>1.2.0</version>
    </parent>

    <artifactId>composum-assets-commons-bundle</artifactId>
    <packaging>bundle</packaging>

    <name>Composum Assets Commons Bundle</name>
    <description>Asset integration services and API</description>

    <properties>
        <bundle.name>com.composum.assets.commons</bundle.name>
    </properties>

    <build>
        <plugins>

            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Category>${bundle.category}</Bundle-Category>
                        <Bundle-SymbolicName>${bundle.name}</Bundle-SymbolicName>
                        <Include-Resource>
                            {maven-resources}
                        </Include-Resource>
                        <Export-Package>
                            com.composum.assets.commons.*,
                            org.imgscalr.*
                        </Export-Package>
                        <Import-Package>
                            com.composum.sling.core.*;version="[2,4)",
                            com.composum.sling.clientlibs.*;version="[2,4)",
                            com.composum.sling.nodes.*;version="[2,4)",
                            com.composum.sling.cpnl.*;version="[2,4)",
                            com.drew.*;version="${com.drewnoakes.metadata-extractor.version}",
                            javax.annotation.*;version="[0,4)",
                            *
                        </Import-Package>
                        <Embed-Dependency>
                            *;scope=compile|runtime
                        </Embed-Dependency>
                    </instructions>
                    <exportScr>true</exportScr>
                </configuration>

                <executions>
                    <!-- Configure extra execution of 'manifest' in process-classes phase to make sure SCR metadata is generated before unit test runs -->
                    <execution>
                        <id>scr-metadata</id>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <supportIncrementalBuild>true</supportIncrementalBuild>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    <dependencies>

        <!-- Scalr image scaling -->
        <dependency>
            <groupId>org.imgscalr</groupId>
            <artifactId>imgscalr-lib</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Composum Core -->
        <dependency>
            <groupId>com.composum.nodes</groupId>
            <artifactId>composum-nodes-console</artifactId>
        </dependency>
        <dependency>
            <groupId>com.composum.nodes</groupId>
            <artifactId>composum-nodes-commons</artifactId>
        </dependency>

        <!-- Composum Platform -->
        <dependency>
            <groupId>com.composum.platform</groupId>
            <artifactId>composum-platform-commons-bundle</artifactId>
        </dependency>
        <dependency>
            <groupId>com.composum.platform</groupId>
            <artifactId>composum-platform-staging-bundle</artifactId>
        </dependency>

        <!-- Sling, JCR -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.xss</artifactId>
            <!-- This is an evil JAR with several old versions of libraries as embedded dependencies that aren't exported
            and can conflict with your code. "Optional" at least means that that doesn't conflict with artifacts
            using a bundle that uses the sling.xss bundle.
             -->
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.jcr.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.servlets.post</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.scheduler</artifactId>
        </dependency>

        <!-- JCR API, Jackrabbit -->
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>jackrabbit-jcr-commons</artifactId>
        </dependency>

        <!-- Tika -->
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-parsers</artifactId>
            <exclusions>
                <!-- These introduce an unwanted dependency to commons-lang and aren't deployed, anyway. -->
                <exclusion>
                    <groupId>com.healthmarketscience.jackcess</groupId>
                    <artifactId>jackcess</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.uima</groupId>
                    <artifactId>uimafit-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-core</artifactId>
        </dependency>

        <!-- JSON -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

        <!-- Apache commons -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <!-- OSGi, Felix -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
        </dependency>

        <!-- Web Application API -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>

        <!-- Java Annotations -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>

        <!-- JUnit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-jcr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.hamcrest</artifactId>
        </dependency>
        <dependency>
            <groupId>com.composum.platform</groupId>
            <artifactId>composum-platform-testing-testutil</artifactId>
            <version>${composum.platform.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- TODO Temporary workaround for https://issues.apache.org/jira/browse/SLING-8576 . Once that's fixed this
          should be removed. -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.core</artifactId>
            <version>2.0.50</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <profiles>

        <profile>
            <id>installBundle</id>
        </profile>
        <profile>
            <id>installPackage</id>
        </profile>
        <profile>
            <id>installTestContent</id>
        </profile>

    </profiles>
</project>
