<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <!-- ====================================================================== -->
  <!-- P A R E N T  P R O J E C T  D E S C R I P T I O N                      -->
  <!-- ====================================================================== -->
  <parent>
    <groupId>org.apache.jackrabbit.vault</groupId>
    <artifactId>parent</artifactId>
    <version>4.2.0</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>

  <!-- ====================================================================== -->
  <!-- P R O J E C T  D E S C R I P T I O N                                   -->
  <!-- ====================================================================== -->
  <artifactId>org.apache.jackrabbit.vault</artifactId>

  <name>Apache Jackrabbit FileVault Core Bundle</name>
  <description>The core classes of Apache Jackrabbit FileVault</description>

  <properties>
    <!-- http://maven.apache.org/ref/3.6.3/maven-model-builder/index.html#Inheritance_Assembly -->
    <project.directory>vault-core</project.directory>
  </properties>

  <!-- ====================================================================== -->
  <!-- D E P E N D E N C I E S                                                -->
  <!-- ====================================================================== -->
  <dependencies>
    <!-- for resolving against a target OSGi container the target OSGi container must be built first -->
    <dependency>
      <groupId>org.apache.jackrabbit.vault</groupId>
      <artifactId>org.apache.jackrabbit.vault.target-osgi-environment</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <!-- jackrabbit -->
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-jackrabbit-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr-commons</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-spi-commons</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-spi</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-spi2dav</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr2spi</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- JCR Stuff -->
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.framework</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- StaX implementation for indentation -->
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>txw2</artifactId>
      <version>2.3.2</version>
      <!-- embedded, therefore not transitively relevant -->
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.woodstox</groupId>
      <artifactId>woodstox-core</artifactId>
      <version>6.5.0</version>
      <!-- embedded, therefore not transitively relevant -->
      <scope>provided</scope>
    </dependency>

    <!-- SLF4j / Log4j -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- OSGi Annotations: @Version -->
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.annotation.versioning</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Declarative Service Annotations -->
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.service.component.annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- Metatype Annotations -->
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.service.metatype.annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <!-- used to retrieve the sling repository for JMX support -->
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.jcr.api</artifactId>
      <version>2.0.4</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>

    <!-- for parsing Maven versions (org.apache.maven.artifact.versioning.ComparableVersion) -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>3.8.4</version>
      <!-- embedded, therefore not transitively relevant -->
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- for the https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/util/CloseWatcher.java -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.2.220</version>
      <scope>provided</scope>
    </dependency>
    <!-- test deps -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-matchers</artifactId>
      <version>2.10.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.util.converter</artifactId>
      <version>1.0.9</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- ====================================================================== -->
  <!-- B U I L D                                                             -->
  <!-- ====================================================================== -->
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <configuration>
            <suppressionFile>${project.basedir}/../suppressions.xml</suppressionFile>
            <!-- only check embedded dependencies, therefore exclude all external dependencies with vulnerabilities (provided by the container) -->
            <excludes>
              <exclude>*:commons-io</exclude>
              <exclude>*:httpclient</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-maven-plugin</artifactId>
      </plugin>
      <!-- create OSGi repo index for target container -->
      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-indexer-maven-plugin</artifactId>
        <version>${bnd.version}</version>
        <executions>
          <execution>
            <id>index</id>
            <goals>
              <goal>local-index</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <inputDir>${project.build.directory}</inputDir>
              <includeGzip>false</includeGzip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-baseline-maven-plugin</artifactId>
        <configuration>
          <diffpackages>
            <!-- temporarily ignore baseline violation for o.a.j.v.fs due to https://issues.apache.org/jira/browse/JCRVLT-546?focusedCommentId=17379780&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17379780 -->
            <diffpackage>!org.apache.jackrabbit.vault.fs</diffpackage>
            <diffpackage>*</diffpackage>
          </diffpackages>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <configuration>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <excludePackageNames>org.apache.jackrabbit.vault.util.xml.*</excludePackageNames>
        </configuration>
      </plugin>
      <!-- ====================================================================== -->
      <!-- R A T   P L U G I N                                                    -->
      <!-- ====================================================================== -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludesFile>${project.basedir}/.ratignore</excludesFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-resolver-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <configuration>
          <excludes>
            <!-- excluded embedded 3rd party libraries -->
            <exclude>com/ctc/wstx/**/*.class</exclude>
            <exclude>org/apache/jackrabbit/jcr2spi/**/*.class</exclude>
            <exclude>org/codehaus/stax/**/*.class</exclude>
            <exclude>org/codehaus/stax2/**/*.class</exclude>
            <exclude>org/h2/**/*.class</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
