<?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>

  <groupId>ca.sickkids.ccm.lfs</groupId>
  <artifactId>lfs-parent</artifactId>
  <version>0.8.4</version>
  <packaging>pom</packaging>

  <name>LFS - Parent POM</name>
  <description>LFS is a software tool providing an easy-to-use Web interface and standardized database back-end for collecting medical data.</description>
  <url>https://ccm.sickkids.ca/</url>
  <inceptionYear>2019</inceptionYear>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/ccmbioinfo/lfs.git</connection>
    <developerConnection>scm:git:git@github.com:phenotips/ccmbioinfo/lfs.git</developerConnection>
    <url>https://github.com/ccmbioinfo/lfs/tree/master/</url>
    <tag>cards-0.8.4</tag>
  </scm>

  <organization>
    <name>The Centre for Computational Medicine at the Hospital for Sick Children Toronto</name>
    <url>https://ccm.sickkids.ca/</url>
  </organization>

  <distributionManagement>
    <site>
      <id>nexus.phenotips.org</id>
      <url>dav:https://nexus.phenotips.org/nexus/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</url>
    </site>
    <repository>
      <id>nexus.phenotips.org</id>
      <name>Maven2 Remote Repository for Releases</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>nexus.phenotips.org</id>
      <name>Maven2 Development Repository for Snapshots</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>phenotips-releases</id>
      <name>PhenoTips Releases repository</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/releases/</url>
      <releases>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>phenotips-snapshots</id>
      <name>PhenoTips Snapshots repository</name>
      <url>https://nexus.phenotips.org/nexus/content/repositories/snapshots/</url>
      <releases>
        <enabled>false</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
    </repository>
    <repository>
      <id>phenotips-externals</id>
      <name>PhenoTips external repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>apache-snapshots</id>
      <name>Apache snapshots</name>
      <url>https://repository.apache.org/content/groups/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>phenotips-externals</id>
      <name>PhenoTips external repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>phenotips-external-snapshots</id>
      <name>PhenoTips external snapshot repositories mirror</name>
      <url>https://nexus.phenotips.org/nexus/content/groups/public-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <lfs.version>${project.version}</lfs.version>
    <app.name>Clinical ARchive for Data Science</app.name>
    <platform.name>CARDS</platform.name>
    <slf4j.version>1.7.26</slf4j.version>
    <jackrabbit.version>2.16.3</jackrabbit.version>
    <oak.version>1.8.8</oak.version>

    <enforcer.skip>false</enforcer.skip>
    <checkstyle.skip>false</checkstyle.skip>
    <dependencyCheck.skip>false</dependencyCheck.skip>
    <coverage.instructionRatio>1.00</coverage.instructionRatio>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Apache Commons -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.8.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>1.6</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.3</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-csv</artifactId>
        <version>1.6</version>
      </dependency>
      <!-- Everybody logs -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!-- Logging framework -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.3</version>
      </dependency>
      <!-- TEST -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.1</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>27.0.1-jre</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>3.0.2</version>
      </dependency>
      <dependency>
        <groupId>net.jcip</groupId>
        <artifactId>jcip-annotations</artifactId>
        <version>1.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <defaultGoal>install</defaultGoal>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>3.2.0</version>
      </extension>
    </extensions>
    <plugins>
      <!-- Show compiler warnings -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>

      <!-- Run Checkstyle on Java code-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>

      <!-- Validate HTL files -->
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>htl-maven-plugin</artifactId>
      </plugin>

      <!-- Check that declared dependencies match what's actually used -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>check-dependencies</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
              <skip>${dependencyCheck.skip}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Fail the build if the test coverage is below a given value. -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.4</version>
        <executions>
          <execution>
            <id>jacoco-prepare</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-check</id>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <rule>
              <limits>
                <limit>
                  <counter>INSTRUCTION</counter>
                  <minimum>${coverage.instructionRatio}</minimum>
                </limit>
              </limits>
            </rule>
          </rules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <!-- Check that all Maven plugins have versions defined -->
          <execution>
            <id>enforce-plugins</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requirePluginVersions>
                  <message>Best Practice is to always define plugin versions!</message>
                  <banLatest>false</banLatest>
                  <banRelease>false</banRelease>
                  <banSnapshots>false</banSnapshots>
                </requirePluginVersions>
              </rules>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <skip>${enforcer.skip}</skip>
        </configuration>
      </plugin>

      <!-- Check that each source file has the right license header. -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.13</version>
        <configuration>
          <excludes combine.children="append">
            <!-- Used by maven-remote-resources-plugin -->
            <exclude>src/main/appended-resources/META-INF/*</exclude>
            <!-- Don't check anything in target -->
            <exclude>**/target/**</exclude>
            <!-- Exclude frontend generated code -->
            <exclude>**/frontend/node/**</exclude>
            <exclude>**/frontend/node_modules/**</exclude>
            <exclude>**/frontend/dist/**</exclude>
            <exclude>**/webpack.config.js</exclude>
            <exclude>**/yarn.lock</exclude>
            <!-- Exclude JSON files since comments are not supported -->
            <exclude>**/*.json</exclude>
            <!-- Documentation files in markdown format -->
            <exclude>**/*.md</exclude>
            <!-- Ignore "hidden" files and folders -->
            <exclude>**/.*</exclude>
            <exclude>**/.*/**</exclude>
            <!-- bnd -->
            <exclude>bnd.bnd</exclude>
            <!-- Ignore file with data for testing -->
            <exclude>**/hpo-test.obo</exclude>
            <exclude>**/chebi-test.obo</exclude>
            <!-- Ignore generated files that are not checked into git anyways -->
            <exclude>compose-cluster/docker-compose.yml</exclude>
            <exclude>compose-cluster/initializer/initialize_all.sh</exclude>
            <exclude>compose-cluster/mongos/mongo-router.conf</exclude>
            <exclude>compose-cluster/shard*/**</exclude>
            <exclude>compose-cluster/secrets/**</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>rat-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.4.1</version>
        </plugin>
        <!-- Apply checkstyle rules and fail the build in case of errors. The checkstyle config
             files are taken from the build-tools JAR module.-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.0</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.29</version>
            </dependency>
            <dependency>
              <groupId>org.phenotips</groupId>
              <artifactId>phenotips-checkstyle-configuration</artifactId>
              <version>1.12</version>
            </dependency>
          </dependencies>
          <configuration>
            <consoleOutput>true</consoleOutput>
            <skip>${checkstyle.skip}</skip>
            <configLocation>checkstyle.xml</configLocation>
          </configuration>
          <executions>
            <execution>
              <id>source-checkstyle</id>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
            <execution>
              <id>test-checkstyle</id>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <configLocation>test-checkstyle.xml</configLocation>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                <sourceDirectories>
                  <sourceDirectory>src/test/java/</sourceDirectory>
                </sourceDirectories>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- Validate HTL files -->
        <plugin>
          <groupId>org.apache.sling</groupId>
          <artifactId>htl-maven-plugin</artifactId>
          <version>1.2.2-1.4.0</version>
          <executions>
            <execution>
              <id>validate-htl</id>
              <goals>
                <goal>validate</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <failOnWarnings>true</failOnWarnings>
            <sourceDirectory>src/main/resources/</sourceDirectory>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.sling</groupId>
          <artifactId>slingstart-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.8.2</version>
          <!-- This allows us to use the "slingstart" and "slingfeature" packaging type -->
          <extensions>true</extensions>
          <configuration>
            <!-- Add the current project version into the provisioning files -->
            <setFeatureVersions>true</setFeatureVersions>
            <!-- Allows using the maven properties defined above as variables in the provisioning files -->
            <usePomVariables>true</usePomVariables>
            <!-- Allow defining versions in the POM file -->
            <usePomDependencies>true</usePomDependencies>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5.3</version>
          <configuration>
            <arguments>-Pquick</arguments>
            <!-- Avoid site generation during the release:perform to speed up release process -->
            <goals>deploy</goals>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <localCheckout>true</localCheckout>
            <pushChanges>false</pushChanges>
            <tagNameFormat>phenotips-@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.0</version>
          <!-- Delete the transpiled fronted code -->
          <configuration>
            <filesets>
              <fileset>
                <directory>src/main/frontend/dist/</directory>
              </fileset>
            </filesets>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.0.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.8.0</version>
          <!-- Java 1.8 is required -->
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
        <!-- Compile the React code -->
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.7.6</version>
          <executions>
            <!-- Installs NodeJS and Yarn locally -->
            <execution>
              <id>install node and yarn</id>
              <goals>
                <goal>install-node-and-yarn</goal>
              </goals>
              <phase>initialize</phase>
            </execution>
            <!-- Brings in the dependencies using yarn -->
            <execution>
              <id>yarn install</id>
              <goals>
                <goal>yarn</goal>
              </goals>
            </execution>
            <!-- Runs webpack to compile the JS source code -->
            <execution>
              <id>webpack</id>
              <goals>
                <goal>webpack</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <nodeVersion>v14.15.0</nodeVersion>
            <yarnVersion>v1.22.10</yarnVersion>
            <workingDirectory>src/main/frontend</workingDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.22.0</version>
          <!-- Rule is to put tests in *Test classes -->
          <configuration>
            <includes>
              <include>**/*Test.class</include>
            </includes>
            <parallel>classesAndMethods</parallel>
            <threadCount>4</threadCount>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.1.1</version>
          <configuration>
            <ignoredUsedUndeclaredDependencies>
              <ignoredUsedUndeclaredDependency>javax.inject:javax.inject</ignoredUsedUndeclaredDependency>
              <ignoredUsedUndeclaredDependency>org.mockito:mockito-core</ignoredUsedUndeclaredDependency>
              <ignoredUsedUndeclaredDependency>junit:junit</ignoredUsedUndeclaredDependency>
              <ignoredUsedUndeclaredDependency>org.hamcrest:hamcrest-library</ignoredUsedUndeclaredDependency>
            </ignoredUsedUndeclaredDependencies>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.8.2</version>
          <!-- We're deploying to Nexus using the WebDAV protocol -->
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>3.2.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>2.10.4</version>
          <configuration>
            <!-- Always exclude the internal package since it's not user-public -->
            <excludePackageNames>*.internal.*</excludePackageNames>
            <!-- Make sure javadoc has enough memory -->
            <maxmemory>300m</maxmemory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.7.1</version>
          <!-- Site Plugin doesn't automatically pull the Apache Wagon implementation -->
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>3.2.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>1.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <!-- Lock down plugin version for build reproducibility -->
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>4.2.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <!-- Use this ( mvn install -Pquick ) when trying to get a quicker test build, without running any quality control checks. -->
      <id>quick</id>
      <properties>
        <enforcer.skip>true</enforcer.skip>
        <checkstyle.skip>true</checkstyle.skip>
        <jacoco.skip>true</jacoco.skip>
        <skipTests>true</skipTests>
        <rat.skip>true</rat.skip>
        <dependencyCheck.skip>true</dependencyCheck.skip>
      </properties>
    </profile>

    <profile>
      <!-- Use this ( mvn install -Pskip-webpack ) when trying to get a quicker test build, without (re)installing any node dependencies. -->
      <id>skip-webpack</id>
      <properties>
        <skip.installyarn>true</skip.installyarn>
        <skip.yarn>true</skip.yarn>
        <skip.webpack>true</skip.webpack>
      </properties>
    </profile>

    <profile>
      <!-- By default the sling running instance is also cleaned. To disable this, use `mvn install -P-clean-instance` -->
      <id>clean-instance</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <!-- Delete the running instance when cleaning -->
            <executions>
              <execution>
                <id>clean-instance</id>
                <phase>clean</phase>
                <goals>
                  <goal>clean</goal>
                </goals>
                <configuration>
                  <filesets>
                    <fileset>
                      <directory>sling/</directory>
                    </fileset>
                  </filesets>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- Node resources are like binary dependencies, so they should be cleaned as well. However, re-downloading Node and its modules for every build is pointless, thus cleaning them is optional. -->
      <id>clean-node</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <!-- Delete node files when cleaning -->
            <executions>
              <execution>
                <id>clean-node</id>
                <phase>clean</phase>
                <goals>
                  <goal>clean</goal>
                </goals>
                <configuration>
                  <filesets>
                    <fileset>
                      <directory>src/main/frontend/</directory>
                      <includes>
                        <include>node/</include>
                        <include>node_modules/</include>
                        <include>yarn.lock</include>
                      </includes>
                    </fileset>
                  </filesets>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- Profile used when the release plugin executes. We want javadocs and source jars to be released
           + ensure we sign files using GPG. -->
      <id>release</id>
      <activation>
        <property>
          <!-- This property is automatically defined by the Maven release plugin when executing
               a release. Thus this profile will be automatically enabled when releasing -->
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <useAgent>true</useAgent>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!--
        Use this profile to install the built module automatically during development.
        Requires a running instance.
        By default it connects to http://localhost:8080 with admin:admin.
        To specify a different password, use `-Dsling.password=newPassword`
        To specify a different URL, use `-Dsling.url=https://lfs.server:8443/system/console` (the URL must end with `/system/console` to work properly)

        TL;DR:
        mvn install -PautoInstallBundle
    -->
    <profile>
      <id>autoInstallBundle</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.sling</groupId>
            <artifactId>maven-sling-plugin</artifactId>
            <version>2.4.0</version>
            <executions>
              <execution>
                <id>install-bundle</id>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Integration tests shouldn't be run for every build, they need to be explicitly triggered using this profile: `mvn install -PintegrationTests` -->
    <profile>
      <id>integrationTests</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>tests</module>
      </modules>
    </profile>
  </profiles>

  <modules>
    <module>modules</module>
    <module>distribution</module>
    <module>lfs-resources</module>
    <module>kids-resources</module>
    <module>cardiac-rehab-resources</module>
  </modules>
</project>
