<?xml version="1.0" encoding="UTF-8"?>
<!--
        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>
    <artifactId>org.apache.sling.cms</artifactId>
    <groupId>org.apache.sling</groupId>
    <version>1.1.8</version>
  </parent>
  <artifactId>org.apache.sling.cms.feature</artifactId>
  <name>Apache Sling - CMS Feature Model</name>
  <properties>
    <IT.expected.bundles.count>240</IT.expected.bundles.count>
    <run.sling.smoke.test>true</run.sling.smoke.test>
  </properties>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}</directory>
              <includes>
                <include>sling/**</include>
                <include>coverage.ec</include>
                <include>launcher/**</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>slingfeature-maven-plugin</artifactId>
        <version>1.7.2</version>
        <extensions>true</extensions>
        <configuration>
          <aggregates>
            <aggregate>
              <classifier>slingcms-standalone</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/composite-*.json</filesExclude>
              <filesExclude>runmodes/author.json</filesExclude>
              <filesExclude>runmodes/renderer.json</filesExclude>
              <title>Sling CMS - Standalone</title>
            </aggregate>
            <aggregate>
              <classifier>slingcms-author</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/composite-*.json</filesExclude>
              <filesExclude>runmodes/standalone.json</filesExclude>
              <filesExclude>runmodes/renderer.json</filesExclude>
              <title>Sling CMS - Author</title>
            </aggregate>
            <aggregate>
              <classifier>slingcms-renderer</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/composite-*.json</filesExclude>
              <filesExclude>runmodes/standalone.json</filesExclude>
              <filesExclude>runmodes/author.json</filesExclude>
              <title>Sling CMS - Renderer</title>
            </aggregate>
            <aggregate>
              <classifier>slingcms-composite-seed</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/composite-runtime.json</filesExclude>
              <filesExclude>oak/node-store/segment.json</filesExclude>
              <filesExclude>runmodes/*.json</filesExclude>
              <title>Sling CMS - Composite Node Store Seed</title>
            </aggregate>
            <aggregate>
              <classifier>slingcms-composite-runtime</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/composite-seed.json</filesExclude>
              <filesExclude>oak/node-store/segment.json</filesExclude>
              <filesExclude>runmodes/*.json</filesExclude>
              <title>Sling CMS - Composite Node Store Runtime</title>
            </aggregate>
            <aggregate>
              <classifier>slingcms-upgrade</classifier>
              <filesInclude>**/*.json</filesInclude>
              <filesExclude>oak/node-store/*.json</filesExclude>
              <filesExclude>runmodes/*.json</filesExclude>
              <title>Sling CMS - Upgrade</title>
            </aggregate>
          </aggregates>
          <scans>
            <scan>
              <includeClassifier>slingcms-composite-runtime</includeClassifier>
            </scan>
            <scan>
              <includeClassifier>slingcms-composite-seed</includeClassifier>
            </scan>
            <scan>
              <includeClassifier>slingcms-standalone</includeClassifier>
            </scan>
            <scan>
              <includeClassifier>slingcms-author</includeClassifier>
            </scan>
            <scan>
              <includeClassifier>slingcms-renderer</includeClassifier>
            </scan>
          </scans>
          <archives>
            <archive>
              <classifier>slingcms_standalone_far</classifier>
              <includeClassifier>slingcms-standalone</includeClassifier>
            </archive>
            <archive>
              <classifier>slingcms_upgrade_far</classifier>
              <includeClassifier>slingcms-upgrade</includeClassifier>
            </archive>
          </archives>
        </configuration>
        <executions>
          <execution>
            <id>aggregate-features</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>aggregate-features</goal>
              <goal>analyse-features</goal>
              <goal>attach-features</goal>
              <goal>attach-featurearchives</goal>
            </goals>
            <configuration>
              <replacePropertyVariables>
                asm.version,org-apache-sling-api-version,org-apache-sling-scripting-jsp-taglib-version,cms-version,composum.nodes.version,groovy.version,guava-version,jackrabbit.version,jackson.version,oak.version,slf4j.version,cocoon-serializers-charsets-version,org.apache.felix.webconsole-version,commons-lang3-version,jstl-version,org-apache-sling-models-api-version,org.apache.sling.scripting.jsp.taglib,geronimo-atinject_1-0_spec-version,commons-io-version,tika-version,pdfbox-version,httpclient-version,org-apache-sling-caconfig-api-version,jsoup-version,org-apache-sling-fileoptim-version,org-apache-sling-engine-version,org-apache-sling-commons-johnzon-version,commons-text-version,org-apache-sling-scripting-api-version</replacePropertyVariables>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <appendAssemblyId>false</appendAssemblyId>
          <finalName>org.apache.sling.cms-${project.version}</finalName>
          <archive>
            <manifest>
              <mainClass>org.apache.sling.cms.feature.Main</mainClass>
              <classpathPrefix>lib/</classpathPrefix>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
          <descriptors>
            <descriptor>src/main/assembly/standalone.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <arguments>-Drun.sling.smoke.test=false</arguments>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <!-- Extend RAT configuration from parent pom -->
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <excludes combine.children="append">
              <!-- Exclude sling instance -->
              <exclude>sling/**</exclude>
              <exclude>launcher/**</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>run-smoke-test</id>
      <activation>
        <property>
          <name>run.sling.smoke.test</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- reserve a network port for the integration tests -->
          <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>pre-integration-test</phase>
                <configuration>
                  <portNames>
                    <portName>http.port</portName>
                  </portNames>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.sling</groupId>
            <artifactId>feature-launcher-maven-plugin</artifactId>
            <version>0.1.6</version>
            <configuration>
              <launches>
                <launch>
                  <id>sling-cms</id>
                  <feature>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <version>${project.version}</version>
                    <classifier>slingcms-standalone</classifier>
                    <type>slingosgifeature</type>
                  </feature>
                  <launcherArguments>
                    <frameworkProperties>
                      <org.osgi.service.http.port>${http.port}</org.osgi.service.http.port>
                    </frameworkProperties>
                  </launcherArguments>
                </launch>
              </launches>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>start</goal>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <systemPropertyVariables>
                <sling.http.port>${http.port}</sling.http.port>
                <IT.expected.bundles.count>${IT.expected.bundles.count}</IT.expected.bundles.count>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpclient-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.utils</artifactId>
      <version>1.11.8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.feature.launcher</artifactId>
      <version>1.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.feature</artifactId>
      <version>1.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.cm.json</artifactId>
      <version>1.0.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.json</groupId>
      <artifactId>javax.json-api</artifactId>
      <version>1.1.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.json</artifactId>
      <version>1.1.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.util.converter</artifactId>
      <version>1.0.9</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.util.function</artifactId>
      <version>1.2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>${commons-text-version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.12.0</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>