<?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">

    <parent>
        <groupId>com.icfolson.aem.library</groupId>
        <artifactId>aem-library</artifactId>
        <version>9.0.0</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>aem-library-models</artifactId>
    <packaging>bundle</packaging>
    <name>AEM Library Models</name>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <exportScr>true</exportScr>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-Vendor>${project.parent.organization.name}</Bundle-Vendor>
                        <Export-Package>!*.impl,com.icfolson.aem.library.models.*</Export-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Require-Bundle>org.apache.sling.models.api</Require-Bundle>
                        <_plugin>org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin;destdir=${project.build.outputDirectory};</_plugin>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <excludePackageNames>*.impl</excludePackageNames>
                            <links>
                                <link>http://docs.oracle.com/javase/7/docs/api/</link>
                                <link>http://docs.oracle.com/javaee/7/api/</link>
                                <link>http://google.github.io/guava/releases/15.0/api/docs/</link>
                                <link>http://www.day.com/maven/jsr170/javadocs/jcr-2.0/</link>
                                <link>http://sling.apache.org/apidocs/sling7</link>
                                <link>https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc</link>
                            </links>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <configuration>
                    <generateReports>false</generateReports>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <!-- activate this profile to enable logging of test executions -->
        <profile>
            <id>test-logging</id>
            <activation>
                <property>
                    <name>test-logging</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                    <version>1.7.5</version>
                </dependency>
                <dependency>
                    <groupId>com.icfolson.aem.prosper</groupId>
                    <artifactId>prosper</artifactId>
                    <exclusions>
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-nop</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <dependencies>
        <!-- provided -->
        <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <classifier>apis</classifier>
        </dependency>

        <!-- third party -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
        </dependency>

        <!-- aem library -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>aem-library-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>aem-library-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>aem-library-core</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>com.icfolson.aem.prosper</groupId>
            <artifactId>prosper</artifactId>
        </dependency>
    </dependencies>
</project>
