<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.alfresco.tas</groupId>
    <artifactId>restapi</artifactId>
    <name>alfresco-tas-restapi</name>
    <version>1.107</version>
    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-super-pom</artifactId>
        <version>12</version>
    </parent>

	<organization>
        <name>Alfresco Software</name>
        <url>http://www.alfresco.com/</url>
    </organization>
    <developers>
        <developer>
            <name>Paul Brodner</name>
            <roles>
                <role>Test Automation Architect</role>
            </roles>
        </developer>
    </developers>
    <properties>
        <!-- please run mvn clean install -DSkipTests in order to have shared-resources available -->
        <suiteXmlFile>src/main/resources/shared-resources/testCount.xml</suiteXmlFile>
        <maven.build.sourceVersion>11</maven.build.sourceVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <tas.utility.version>3.0.49</tas.utility.version>
        <rest-assured.version>5.1.1</rest-assured.version>
        <httpclient-osgi-version>4.5.6</httpclient-osgi-version>
        <jackson-databind.version>2.13.3</jackson-databind.version>
        <maven-release.version>2.5.3</maven-release.version>
        <org.glassfish.version>1.1.4</org.glassfish.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <scribejava-apis.version>8.3.1</scribejava-apis.version>
        <license-maven-plugin.version>2.0.1.alfresco-2</license-maven-plugin.version>
        <license.update.copyright>false</license.update.copyright>
        <license.update.dryrun>true</license.update.dryrun>
        <license.name>community</license.name>
        <test.exclude />
        <test.include />
        <java.version>11</java.version>
    </properties>

    <profiles>
        <profile>
            <id>rest-api-explorer-master</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <rest.api.explorer.branch>master</rest.api.explorer.branch>
            </properties>
        </profile>
        <profile>
            <id>rest-api-explorer-52N</id>
            <properties>
                <rest.api.explorer.branch>5.2.N</rest.api.explorer.branch>
            </properties>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</connection>
        <developerConnection>scm:git:https://github.com/Alfresco/alfresco-tas-restapi.git</developerConnection>
        <url>https://github.com/Alfresco/alfresco-tas-restapi</url>
        <tag>v1.107</tag>
    </scm>

    <issueManagement>
        <system>JIRA</system>
        <url>https://issues.alfresco.com/jira/browse/</url>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- Alfresco Repository -->
    <repositories>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>${java.version}</release>                    
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>                    
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release.version}</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <doclint>none</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <arguments>
                        <argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-auth.yaml</argument>
                        <argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-core.yaml</argument>
                        <argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-discovery.yaml</argument>
                        <argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-search.yaml</argument>
                        <argument>https://raw.githubusercontent.com/Alfresco/rest-api-explorer/${rest.api.explorer.branch}/src/main/webapp/definitions/alfresco-workflow.yaml</argument>
                    </arguments>
                    <mainClass>org.alfresco.rest.core.swagger.Generator</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.3</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>check-licenses</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <configuration>
                            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                            <organizationName>Alfresco Software Limited</organizationName>
                            <canUpdateCopyright>${license.update.copyright}</canUpdateCopyright>
                            <failOnMissingHeader>true</failOnMissingHeader>
                            <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                            <licenseResolver>classpath://alfresco</licenseResolver>
                            <licenseName>${license.name}</licenseName>
                            <dryRun>${license.update.dryrun}</dryRun>
                            <roots>
                                <root>src</root>
                            </roots>
                            <includes>
                                <include>**/*.java</include>
                                <include>**/*.jsp</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.alfresco</groupId>
                        <artifactId>alfresco-license-headers</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- fix the info log messages related to Could not instantiate TestExecutionListener 
            [org.springframework.test.context.web.ServletTestExecutionListener -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <!-- alfresco tester settings -->
        <dependency>
            <groupId>org.alfresco.tas</groupId>
            <artifactId>utility</artifactId>
            <version>${tas.utility.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                	<artifactId>commons-lang3</artifactId>
                	<groupId>org.apache.commons</groupId>
                </exclusion>
                <exclusion>
                	<artifactId>commons-lang</artifactId>
                	<groupId>commons-lang</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

        <!-- REST ASSURED -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-osgi</artifactId>
            <version>${httpclient-osgi-version}</version>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest-assured.version}</version>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>json-path</artifactId>
            <version>${rest-assured.version}</version>
            <exclusions>
            	<exclusion>
            		<artifactId>commons-lang3</artifactId>
            		<groupId>org.apache.commons</groupId>
            	</exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>xml-path</artifactId>
            <version>${rest-assured.version}</version>
            <exclusions>
            	<exclusion>
            		<artifactId>commons-lang3</artifactId>
            		<groupId>org.apache.commons</groupId>
            	</exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>json-schema-validator</artifactId>
            <version>${rest-assured.version}</version>
        </dependency>

        <dependency>
            <groupId>com.github.scribejava</groupId>
            <artifactId>scribejava-apis</artifactId>
            <version>${scribejava-apis.version}</version>
        </dependency>

        <!-- JSON to Object -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson-databind.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.glassfish/javax.json -->
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>${org.glassfish.version}</version>
        </dependency>

        <!-- needed for swagger parser bellow -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.36</version>
        </dependency>
        
		<!-- swagger parser -->
		<dependency>
			<groupId>io.swagger</groupId>
			<artifactId>swagger-parser</artifactId>
			<version>1.0.61</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-lang3</artifactId>
					<groupId>org.apache.commons</groupId>
				</exclusion>
			</exclusions>
		</dependency>

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.12.2</version>
        </dependency>
        
		<!--fixing java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')  -->              
       	<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy -->
		<dependency>
		    <groupId>org.codehaus.groovy</groupId>
		    <artifactId>groovy</artifactId>
		    <version>3.0.12</version>
		</dependency>
		
		<!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json-->
		<dependency>
		    <groupId>org.codehaus.groovy</groupId>
		    <artifactId>groovy-json</artifactId>
		    <version>3.0.12</version>
		</dependency>

       <dependency>
           <groupId>org.mockito</groupId>
           <artifactId>mockito-core</artifactId>
           <version>4.2.0</version>
           <scope>test</scope>
       </dependency>
	</dependencies>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.4.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependencies</report>
                            <report>issue-tracking</report>
                            <report>scm</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>
