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

    Copyright 2019 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">
    
    <parent>
        <groupId>com.adobe.commerce.cif</groupId>
        <artifactId>cif-connector-parent</artifactId>
        <version>0.1.2</version>
        <relativePath>../../parent/pom.xml</relativePath>
    </parent>
    
    <modelVersion>4.0.0</modelVersion>
    <artifactId>cif-connector-graphql</artifactId>
    <version>0.2.0</version>
    <packaging>bundle</packaging>
    
    <name>CIF Connector - GraphQL Bundle</name>
    <description>CIF GraphQL Connector for AEM Commerce authoring</description>
    <url>https://github.com/adobe/commerce-cif-connector/bundles/cif-connector-graphql</url>
    
    <scm>
        <connection>scm:git:https://github.com/adobe/commerce-cif-connector</connection>
        <developerConnection>scm:git:git@github.com:adobe/commerce-cif-connector.git</developerConnection>
        <url>https://github.com/adobe/commerce-cif-connector/bundles/cif-connector-graphql</url>
        <tag>cif-connector-graphql-0.2.0</tag>
    </scm>
    <organization>
        <name>Adobe</name>
        <url>https://www.adobe.com</url>
    </organization>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    
    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <exportScr>true</exportScr>
                    <instructions>
                        <Export-Package>!*</Export-Package>
                        <Import-Package>
                            !javax.annotation,
                            *
                        </Import-Package>
                        <!-- Enable processing of OSGI DS component annotations -->
                        <_dsannotations>*</_dsannotations>
                        <!-- Enable processing of OSGI metatype annotations -->
                        <_metatypeannotations>*</_metatypeannotations>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>baseline</id>
                        <goals>
                            <goal>baseline</goal>
                        </goals>
                    </execution>
                    <!-- Configure extra execution of 'manifest' in process-classes phase to make sure SCR metadata is generated before unit test runs -->
                    <execution>
                        <id>scr-metadata</id>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                        <configuration>
                            <supportIncrementalBuild>true</supportIncrementalBuild>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <configuration>
                    <excludes combine.children="append">
                        <exclude>src/test/resources/**/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            
        </plugins>
    </build>
    
    <dependencies>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <version>1.12.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.adobe.commerce.cif</groupId>
            <artifactId>graphql-client</artifactId>
            <version>1.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Magento GraphQL models and query builders -->
        <dependency>
            <groupId>com.adobe.commerce.cif</groupId>
            <artifactId>magento-graphql</artifactId>
            <version>2.0.0-magento231</version>
            <scope>provided</scope>
        </dependency>

        <!-- Virtual catalog support -->
        <dependency>
            <groupId>com.adobe.commerce.cif</groupId>
            <artifactId>cif-virtual-catalog</artifactId>
            <version>0.1.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>    
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-tagging</artifactId>
            <version>5.8.6</version>
            <scope>provided</scope>
        </dependency>

        <!-- OSGi Dependencies -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
        </dependency>
        
        <!-- Javax annotations -->
        <dependency>
            <groupId>org.apache.sling</groupId> 
            <artifactId>org.apache.sling.jcr.jcr-wrapper</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.servlet-api</artifactId>
        </dependency>

        <!-- AEM Uber JAR -->
        <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <classifier>apis</classifier>
        </dependency>

        <!-- Testing from parent pom -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
        </dependency>
        
        <!-- Testing -->
        <dependency>
            <groupId>io.wcm</groupId>
            <artifactId>io.wcm.testing.aem-mock.junit4</artifactId>
            <version>2.4.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
        </dependency>
    </dependencies>
    
    <profiles>
        <profile>
            <id>autoInstall</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.sling</groupId>
                        <artifactId>maven-sling-plugin</artifactId>
                        <executions>
	                        <execution>
	                            <goals>
	                                <goal>install</goal>
	                            </goals>
	                        </execution>
	                    </executions>
                        <configuration>
                            <slingUrl>http://${aem.host}:${aem.port}${aem.contextPath}/system/console</slingUrl>
                            <failOnError>true</failOnError>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
