<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2017 Adobe. All rights reserved.
    This file is licensed to you 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 REPRESENTATIONS
    OF ANY KIND, either express or implied. See the License for the specific language
    governing permissions and limitations under the License.

-->
<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>
  <packaging>bundle</packaging>
  <artifactId>com.adobe.aio-lib-java.osgi</artifactId>
  <name>Adobe I/O - Java SDK - OSGI bundle</name>
  <description>Adobe I/O - Java SDK - OSGI bundle</description>
  <version>0.0.6</version>

  <parent>
    <groupId>com.adobe</groupId>
    <artifactId>aio-lib-java</artifactId>
    <version>0.0.6</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  
  <properties>
    <org.osgi.framework.version>1.9.0</org.osgi.framework.version>

    <!--
    If you want to deploy the bundle from the source
    1. modify the below `crx.*` properties according to your needs
    2. run `mvn -Dcrx.path=/apps/changeMe/install -Dlicense.header.path=../copyright_header.txt -P localInstall clean install sling:install`
     -->
    <crx.host>localhost</crx.host>
    <crx.port>4502</crx.port>
    <crx.username>admin</crx.username>
    <crx.password>admin</crx.password>

  </properties>

  <dependencies>
    <dependency>
      <groupId>com.adobe</groupId>
      <artifactId>aio-lib-java-ims</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe</groupId>
      <artifactId>aio-lib-java-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe</groupId>
      <artifactId>aio-lib-java-events-mgmt</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe</groupId>
      <artifactId>aio-lib-java-events-ingress</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe</groupId>
      <artifactId>aio-lib-java-events-journal</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-api</artifactId>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-impl</artifactId>
    </dependency>
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt-jackson</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.openfeign.form</groupId>
      <artifactId>feign-form</artifactId>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.framework</artifactId>
      <version>${org.osgi.framework.version}</version>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>maven-sling-plugin</artifactId>
        <version>2.1.8</version>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>3.5.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <_noee>true</_noee>
            <Bundle-Activator>com.adobe.aio.lib.Activator</Bundle-Activator>
            <Bundle-Vendor>Adobe</Bundle-Vendor>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Embed-Dependency>
              aio-lib-java-ims,
              aio-lib-java-core,
              aio-lib-java-events-mgmt,
              aio-lib-java-events-ingress,
              aio-lib-java-events-journal,
              commons-text,
              jjwt-api,
              jjwt-impl,
              jjwt-jackson,
              feign-core,
              feign-form,
              feign-slf4j,
              feign-jackson,
              commons-lang3
            </Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>
              !com.sun.tools.*,
              !org.apache.tools.ant.*,
              !org.eclipse.core.*,
              !org.eclipse.jdt.core.*,
              !org.eclipse.jdt.internal.*,
              !com.sun.activation.*,
              !sun.misc.*,
              !lombok.*,
              !jakarta.xml.bind.*,
              !jakarta.activation.*,
              *
            </Import-Package>
            <Export-Package>
              feign.*,com.adobe,com.adobe.util,com.adobe.event.publish,com.adobe.event.publish.api,
              com.adobe.event.publish.model,com.adobe.event.journal,com.adobe.event.journal.api,
              com.adobe.event.journal.model,com.adobe.event.management,com.adobe.event.management.api,
              com.adobe.event.management.model,com.adobe.ims,com.adobe.ims.api,com.adobe.ims.model,
              com.adobe.ims.util,com.fasterxml.jackson.*,
              com.adobe.aio.lib.Activator
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>

  </build>


  <!-- ====================================================================== -->
  <!-- P R O F I L E S                                                        -->
  <!-- ====================================================================== -->
  <profiles>
    <profile>
      <id>localInstall</id>
      <activation>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.sling</groupId>
            <artifactId>maven-sling-plugin</artifactId>
            <configuration>
              <slingUrl>http://${crx.host}:${crx.port}${crx.path}</slingUrl>
              <user>${crx.username}</user>
              <password>${crx.password}</password>
              <deploymentMethod>WebDAV</deploymentMethod>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>


</project>
