<?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>
    <!-- ====================================================================== -->
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->
    <parent>
        <groupId>com.adobe.acs</groupId>
        <artifactId>acs-aem-commons</artifactId>
        <version>3.1.0</version>
    </parent>

    <!-- ====================================================================== -->
    <!-- P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->

    <artifactId>acs-aem-commons-content</artifactId>
    <name>ACS AEM Commons Package</name>
    <packaging>content-package</packaging>

    <build>
        <resources>
            <resource>
                <directory>src/main/content/jcr_root</directory>
                <excludes>
                    <exclude>**/.vlt</exclude>
                    <exclude>**/.vltignore</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/content/META-INF/vault/definition</directory>
                <targetPath>../vault-work/META-INF/vault/definition</targetPath>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <includeEmptyDirs>true</includeEmptyDirs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <group>adobe/consulting</group>
                    <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
                    <embeddeds>
                        <embedded>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>acs-aem-commons-bundle</artifactId>
                            <target>/apps/acs-commons/install</target>
                        </embedded>
                        <embedded>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>acs-aem-commons-bundle-twitter</artifactId>
                            <target>/apps/acs-commons/install</target>
                        </embedded>
                    </embeddeds>
                    <targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>com.cj.jshintmojo</groupId>
                <artifactId>jshint-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>lint</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <directories>
                        <directory>src/main/content/jcr_root</directory>
                    </directories>
                    <failOnError>true</failOnError>
                    <globals>jQuery,window,$</globals>
                    <excludes>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/components/content/base/ajax/loading-indicator-clientlibs/js/vendor/spin.min.js</exclude>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/extensions/contentfinder/audio.js</exclude>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/authoring/vendor/jquery.fonticonpicker/jquery.fonticonpicker.js</exclude>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/components/utilities/version-compare/clientlibs/js/vendor/jquery.jsPlumb-1.7.2-min.js</exclude>
                        <exclude>/src/main/content/jcr_root/etc/clientlibs/acs-commons/vendor</exclude>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/authoring/vendor/leaflet/js/leaflet.js</exclude>
                        <exclude>/src/main/content/jcr_root/apps/acs-commons/components/dam/asset-location-map/asset-location-map.js</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- configuration to create minimal package -->
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>create-min-package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>${pom.basedir}/src/main/script/CreateMinPackage.groovy</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.artifactId}-${project.version}-min.zip</file>
                                    <type>zip</type>
                                    <classifier>min</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>acs-aem-commons-bundle</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>acs-aem-commons-bundle-twitter</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.day.cq.wcm</groupId>
            <artifactId>cq-wcm-taglib</artifactId>
            <version>5.6.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>
            <version>2.1.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.day.commons</groupId>
            <artifactId>day-commons-jstl</artifactId>
            <version>1.1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <classifier>apis</classifier>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>org.twitter4j</groupId>
            <artifactId>twitter4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>

    </dependencies>
    <profiles>
        <profile>
            <id>autoInstallPackage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.day.jcr.vault</groupId>
                        <artifactId>content-package-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>install-content-package</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
