<?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>
    <groupId>com.icfolson.aem.groovy.console</groupId>
    <artifactId>aem-groovy-console</artifactId>
    <packaging>jar</packaging>
    <version>16.0.0</version>
    <name>AEM Groovy Console</name>
    <description>
        The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be
        created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling,
        or JCR APIs.
    </description>

    <url>https://github.com/icfnext/aem-groovy-console</url>

    <organization>
        <name>ICF Next</name>
        <url>http://www.icfnext.com</url>
    </organization>

    <developers>
        <developer>
            <name>Mark Daugherty</name>
            <email>mark.daugherty@avionos.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:icfnext/aem-groovy-console.git</connection>
        <developerConnection>scm:git:git@github.com:icfnext/aem-groovy-console.git</developerConnection>
        <url>https://github.com/icfnext/aem-groovy-console</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/icfnext/aem-groovy-console/issues</url>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss.SSSZ</maven.build.timestamp.format>
        <timestamp>${maven.build.timestamp}</timestamp>
        <aem.package.skip>true</aem.package.skip>
        <aem.package.goal>install</aem.package.goal>
        <aem.username>admin</aem.username>
        <aem.context.path/>
        <osgi.bundle.status.skip>true</osgi.bundle.status.skip>
        <osgi.bundle.status.skip.publish>true</osgi.bundle.status.skip.publish>
        <assembly.descriptor.name>zip.xml</assembly.descriptor.name>
    </properties>

    <profiles>
        <profile>
            <id>exclude-groovy-bundle</id>
            <activation>
                <property>
                    <name>exclude-groovy-bundle</name>
                </property>
            </activation>
            <properties>
                <assembly.descriptor.name>zip-exclude-groovy-bundle.xml</assembly.descriptor.name>
                <aem.package.fileName>${project.build.directory}/${project.build.finalName}-exclude-groovy-bundle.zip</aem.package.fileName>
            </properties>
        </profile>
        <profile>
            <id>local</id>
            <activation>
                <property>
                    <name>local</name>
                </property>
            </activation>
            <properties>
                <aem.package.skip>false</aem.package.skip>
                <aem.host>localhost</aem.host>
                <aem.port.author>4502</aem.port.author>
                <aem.port.publish>4503</aem.port.publish>
                <aem.username>admin</aem.username>
                <aem.password>admin</aem.password>
                <osgi.bundle.status.skip>false</osgi.bundle.status.skip>
            </properties>
        </profile>
        <profile>
            <id>replicate</id>
            <activation>
                <property>
                    <name>replicate</name>
                </property>
            </activation>
            <properties>
                <aem.package.goal>replicate</aem.package.goal>
                <osgi.bundle.status.skip.publish>false</osgi.bundle.status.skip.publish>
            </properties>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>utf-8</encoding>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.9.2-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.4.3-01</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>4.2.1</version>
                <inherited>true</inherited>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>generate-manifest</id>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>bundle</id>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <unpackBundle>true</unpackBundle>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                        <Export-Package>!*.impl,com.icfolson.aem.groovy.console.*</Export-Package>
                        <Sling-Model-Packages>com.icfolson.aem.groovy.console.components</Sling-Model-Packages>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                    <includes>
                        <include>**/*Spec*</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/zip.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                    <execution>
                        <id>package-exclude-groovy-bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>true</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/zip-exclude-groovy-bundle.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                    <execution>
                        <id>javadoc</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/javadoc.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.icfolson.maven.plugins</groupId>
                <artifactId>aem-package-maven-plugin</artifactId>
                <version>0.7.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>${aem.package.goal}</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <host>${aem.host}</host>
                    <port>${aem.port.author}</port>
                    <contextPath>${aem.context.path}</contextPath>
                    <username>${aem.username}</username>
                    <password>${aem.password}</password>
                    <skip>${aem.package.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.icfolson.maven.plugins</groupId>
                <artifactId>osgi-bundle-status-maven-plugin</artifactId>
                <version>2.0.2</version>
                <executions>
                    <execution>
                        <id>status-author</id>
                        <phase>package</phase>
                        <goals>
                            <goal>status</goal>
                        </goals>
                        <configuration>
                            <bundleNames>
                                <bundleName>aem-groovy-extension-bundle</bundleName>
                                <bundleName>aem-groovy-console;${project.version}</bundleName>
                            </bundleNames>
                            <host>${aem.host}</host>
                            <port>${aem.port.author}</port>
                            <contextPath>${aem.context.path}</contextPath>
                            <username>${aem.username}</username>
                            <password>${aem.password}</password>
                            <retryDelay>5000</retryDelay>
                        </configuration>
                    </execution>
                    <execution>
                        <id>status-publish</id>
                        <phase>package</phase>
                        <goals>
                            <goal>status</goal>
                        </goals>
                        <configuration>
                            <bundleNames>
                                <bundleName>aem-groovy-extension-bundle</bundleName>
                                <bundleName>aem-groovy-console;${project.version}</bundleName>
                            </bundleNames>
                            <host>${aem.host}</host>
                            <port>${aem.port.publish}</port>
                            <contextPath>${aem.context.path}</contextPath>
                            <username>${aem.username}</username>
                            <password>${aem.password}</password>
                            <skip>${osgi.bundle.status.skip.publish}</skip>
                            <retryDelay>5000</retryDelay>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- compile -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.metatype.annotations</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.event</artifactId>
            <version>1.4.0</version>
        </dependency>

        <!-- provided -->
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.5.0-b01</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.annotation</artifactId>
            <version>6.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.5</version>
            <scope>provided</scope>
        </dependency>

        <!-- groovy -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.15</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.icfolson.aem.groovy.extension</groupId>
            <artifactId>aem-groovy-extension-bundle</artifactId>
            <version>7.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>com.icfolson.aem.prosper</groupId>
            <artifactId>prosper</artifactId>
            <version>15.1.0</version>
            <scope>test</scope>
        </dependency>

        <!-- uber jar included last to allow other dependencies to override included versions -->
        <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <classifier>apis</classifier>
            <version>6.3.2</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
