<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  wcm.io
  %%
  Copyright (C) 2014 wcm.io
  %%
  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.
  #L%
  -->

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.wcm</groupId>
    <artifactId>io.wcm.handler.parent</artifactId>
    <version>1.0.0</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>

  <groupId>io.wcm</groupId>
  <artifactId>io.wcm.handler.media</artifactId>
  <version>1.0.0</version>
  <packaging>bundle</packaging>

  <name>Media Handler</name>
  <description>Media resolving, processing and markup generation.</description>

  <scm>
    <connection>scm:git:https://github.com/wcm-io/wcm-io-handler.git</connection>
    <developerConnection>scm:git:https://github.com/wcm-io/wcm-io-handler.git</developerConnection>
    <url>https://github.com/wcm-io/wcm-io-handler</url>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <site.url.module.prefix>handler/media</site.url.module.prefix>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.wcm</groupId>
      <artifactId>io.wcm.handler.url</artifactId>
      <version>1.0.0</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <scope>compile</scope>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
        <groupId>io.wcm.devops.maven.plugins</groupId>
        <artifactId>eclipse-maven-plugin</artifactId>
        <configuration>
          <addVersionToProjectName>false</addVersionToProjectName>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>

            <Sling-Model-Packages>
              io.wcm.handler.media,
              io.wcm.handler.mediasource.dam,
              io.wcm.handler.mediasource.inline
            </Sling-Model-Packages>

            <!-- include application path as intial content -->
            <Sling-Initial-Content>SLING-INF/app-root;overwrite:=true;ignoreImportProviders:=xml;path:=/apps/wcm-io/handler/media</Sling-Initial-Content>

            <!-- Exported package versions differ in major version between AEM61 and AEM62 -->
            <Import-Package>
              com.day.cq.commons;version="[5.7,7)",
              *
            </Import-Package>

          </instructions>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>

      <!-- Group JavaDocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <groups>
            <group>
              <title>Media Handler</title>
              <packages>io.wcm.handler.media:io.wcm.handler.media.*</packages>
            </group>
            <group>
              <title>DAM Media Source</title>
              <packages>io.wcm.handler.mediasource.dam:io.wcm.handler.mediasource.dam.*</packages>
            </group>
            <group>
              <title>Inline Media Source</title>
              <packages>io.wcm.handler.mediasource.inline:io.wcm.handler.mediasource.inline.*</packages>
            </group>
          </groups>
        </configuration>
      </plugin>

    </plugins>
  </reporting>

  <distributionManagement>
    <site>
      <id>${site.deploy.id}</id>
      <url>${site.deploy.url}${site.url.module.prefix}</url>
    </site>
  </distributionManagement>

</project>
