<?xml version="1.0"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ 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 CONDITIONS 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling-bundle-parent</artifactId>
        <version>48</version>
        <relativePath />
    </parent>

    <artifactId>org.apache.sling.scripting.sightly.testing</artifactId>
    <!--
        The versioning scheme defined here corresponds to SLING-7406 (<module_version>-<htl_specification_version>). Take care when
        releasing to only increase the first part, unless the module provides support for a newer version of the HTL specification.
    -->
    <version>1.0.38-1.4.0</version>

    <name>Apache Sling Scripting HTL Testing</name>
    <description>This project runs the integration tests for validating the Apache Sling Scripting HTL implementation
        against the Adobe HTL TCK.
    </description>

    <scm>
        <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing.git</developerConnection>
        <url>https://github.com/apache/sling-org-apache-sling-scripting-sightly-testing.git</url>
      <tag>org.apache.sling.scripting.sightly.testing-1.0.38-1.4.0</tag>
  </scm>

    <properties>
        <sling.java.version>8</sling.java.version>
        <!-- run modes for integration tests -->
        <sling.run.modes>oak_tar</sling.run.modes>

        <!-- path suffix for HTTP access to Sling -->
        <http.base.path />

        <!-- hostname for integration tests -->
        <test.host>localhost</test.host>

        <!-- optionally exclude some integration tests  -->
        <failsafe.exclude />

        <!--
            Set this to true to stop mvn once the integration test Jetty instance is
            started. Useful to manually test the integration testing webapp.
        -->
        <integration.test.wait>false</integration.test.wait>

        <!--
        if set to "true" this will start the launchpad with the following debug options:
            -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

        otherwise you can provide your own debug settings
        -->
        <debug.options />
        <keepInstanceRunning>false</keepInstanceRunning>

        <project.build.outputTimestamp>2025-01-27T13:46:52Z</project.build.outputTimestamp>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>derby.log</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>htl-maven-plugin</artifactId>
                <version>2.0.0-1.4.0</version>
                <executions>
                    <execution>
                        <id>validate-htl-scripts</id>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <generateJavaClasses>true</generateJavaClasses>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>scriptingbundle-maven-plugin</artifactId>
                <version>0.2.2</version>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>metadata</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scriptEngineMappings>
                        <js>rhino</js>
                    </scriptEngineMappings>
                </configuration>
            </plugin>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bnd-process</id>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                        <configuration>
                            <bnd><![CDATA[
-plugin.slingmodels: org.apache.sling.bnd.models.ModelsScannerPlugin
Provide-Capability: ${org.apache.sling.scriptingbundle.maven.plugin.Provide-Capability}
Require-Capability: osgi.extender;filter:="(&(osgi.extender=sling.scripting)(version>=1.0.0)(!(version>=2.0.0)))",${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
                                ]]></bnd>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.sling</groupId>
                        <artifactId>org.apache.sling.bnd.models</artifactId>
                        <version>1.0.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-baseline-maven-plugin</artifactId>
                <configuration>
                    <failOnMissing>false</failOnMissing>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>reserve-network-port</id>
                        <goals>
                            <goal>reserve-network-port</goal>
                        </goals>
                        <phase>process-resources</phase>
                        <configuration>
                            <portNames>
                                <portName>http.port</portName>
                                <portName>sling.control.port</portName>
                            </portNames>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>slingstart-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <usePomDependencies>true</usePomDependencies>
                    <servers>
                        <server>
                            <port>${http.port}</port>
                            <controlPort>${sling.control.port}</controlPort>
                            <runmode>${sling.run.modes}</runmode>
                            <contextPath>${http.base.path}</contextPath>
                            <!-- use Java8 compatible date/number formatting: https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-A20F2989-BFA9-482D-8618-6CBB4BAAE310 -->
                            <!-- SLING-10698 use GMT timezone so dateformat related tests from io.sightly.tck are not off by hours -->
                            <vmOpts>-Xmx1024m -XX:MaxPermSize=256m -Djava.awt.headless=true -Djava.locale.providers=COMPAT,CLDR -Duser.timezone=GMT</vmOpts>
                            <debug>${debug.options}</debug>
                        </server>
                    </servers>
                    <disableExtendingMavenClasspath>true</disableExtendingMavenClasspath>
                    <modelDirectory>${project.basedir}/src/test/provisioning</modelDirectory>
                    <usePomDependencies>true</usePomDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>customise-starter</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-package</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>package-starter</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <attachArtifact>false</attachArtifact>
                        </configuration>
                    </execution>
                    <execution>
                        <id>start-container</id>
                        <goals>
                            <goal>start</goal>
                            <goal>stop</goal>
                        </goals>
                        <configuration>
                            <keepLaunchpadRunning>${keepInstanceRunning}</keepLaunchpadRunning>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <id>integration-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>%regex[.*LaunchpadReadyIT.*]</include>
                        <include>%regex[.*SlingSpecificsSightlyIT.*]</include>
                        <include>%regex[.*TestsRunner.*]</include>
                        <include>%regex[.*PerformanceIT.*]</include>
                    </includes>
                    <dependenciesToScan>
                        <dependency>io.sightly:io.sightly.tck</dependency>
                    </dependenciesToScan>
                    <runOrder>alphabetical</runOrder>
                    <excludes>
                        <exclude>${failsafe.exclude}</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <io.sightly.tck.serverURL>http://${test.host}:${http.port}</io.sightly.tck.serverURL>
                        <io.sightly.tck.user>admin</io.sightly.tck.user>
                        <io.sightly.tck.pass>admin</io.sightly.tck.pass>
                        <launchpad.http.port>${http.port}</launchpad.http.port>
                        <launchpad.http.server.url>http://${test.host}:${http.port}</launchpad.http.server.url>
                        <launchpad.servlet.context>${http.base.path}</launchpad.servlet.context>
                        <IT.expected.bundles.count>177</IT.expected.bundles.count>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.sling
                                        </groupId>
                                        <artifactId>
                                            scriptingbundle-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.2.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>metadata</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
            <version>2.26.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation.versioning</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.models.api</artifactId>
            <version>1.3.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-atinject_1.0_spec</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-annotation_1.3_spec</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- The integration tests -->
        <dependency>
            <groupId>io.sightly</groupId>
            <artifactId>io.sightly.tck</artifactId>
            <version>1.4.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Launchpad dependencies -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly.runtime</artifactId>
            <version>1.2.6-1.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly.compiler</artifactId>
            <version>1.2.14-1.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly.compiler.java</artifactId>
            <version>1.2.2-1.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly</artifactId>
            <version>1.4.26-1.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly.js.provider</artifactId>
            <version>1.2.12</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.sightly.testing-content</artifactId>
            <version>1.0.34-1.4.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.spi</artifactId>
            <version>1.0.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.scripting.core</artifactId>
            <version>2.4.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.servlets.resolver</artifactId>
            <version>2.9.8</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.resourceresolver</artifactId>
            <version>1.10.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.engine</artifactId>
            <version>2.10.2</version>
            <scope>provided</scope>
        </dependency>


        <!-- Dependencies for the Test Build and Run -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.rules</artifactId>
            <version>1.0.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.clients</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Dependency for running Sling performance tests -->
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.performance.base</artifactId>
            <version>1.0.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.utils</artifactId>
            <version>1.11.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>