<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2023 ConnId (connid-dev@googlegroups.com)

    Licensed 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/xsd/maven-4.0.0.xsd">
      
  <modelVersion>4.0.0</modelVersion>
  
  <parent>
    <groupId>net.tirasa.connid</groupId>
    <artifactId>connid</artifactId>
    <version>1.5.2.0</version>
  </parent>
    
  <groupId>net.tirasa.connid.bundles</groupId>
  <artifactId>net.tirasa.connid.bundles.scim</artifactId>
  <version>1.0.3</version>     

  <name>ConnId Bundles: SCIM</name>
  
  <packaging>jar</packaging>
  
  <url>http://connid.tirasa.net</url>
  <inceptionYear>2023</inceptionYear>
  
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <scm>
    <connection>scm:git:git@github.com:Tirasa/ConnIdSCIMBundle.git</connection>
    <url>scm:git:git@github.com:Tirasa/ConnIdSCIMBundle.git</url>
    <developerConnection>scm:git:git@github.com:Tirasa/ConnIdSCIMBundle.git</developerConnection>
    <tag>net.tirasa.connid.bundles.scim-1.0.3</tag>
  </scm>

  <issueManagement>
    <system>jira</system>
    <url>https://connid.atlassian.net/browse/SCIM</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Workflow</system>
    <url>https://github.com/Tirasa/ConnIdSCIMBundle/actions</url>
  </ciManagement>

  <mailingLists>
    <mailingList>
      <name>connid-dev</name>
      <post>connid-dev@googlegroups.com</post>
      <archive>http://groups.google.com/group/connid-dev</archive>
    </mailingList>
    <mailingList>
      <name>connid-users</name>
      <post>connid-users@googlegroups.com</post>
      <archive>http://groups.google.com/group/connid-users</archive>
    </mailingList>
  </mailingLists>

  <properties>
    <connid.version>1.5.2.0</connid.version>

    <jackson.version>2.13.5</jackson.version>
    <cxf.version>3.3.13</cxf.version>
    <java.version>1.8</java.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>net.tirasa.connid</groupId>
      <artifactId>connector-framework</artifactId>
      <version>${connid.version}</version>
    </dependency>
    <dependency>
      <groupId>net.tirasa.connid</groupId>
      <artifactId>connector-framework-internal</artifactId>
      <version>${connid.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
      <version>${cxf.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.woodstox</groupId>
          <artifactId>woodstox-core-asl</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.ws.xmlschema</groupId>
          <artifactId>xmlschema-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-extension-search</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-hc</artifactId>
      <version>${cxf.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

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

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- TEST -->        
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>1.18.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>4.11.0</version>
      <scope>test</scope>
    </dependency>    
    <dependency>
      <groupId>net.tirasa.connid</groupId>
      <artifactId>connector-test-common</artifactId>
      <version>${connid.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
    
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <inherited>false</inherited>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <useIncrementalCompilation>false</useIncrementalCompilation>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <compilerArgument>-Xlint:unchecked</compilerArgument>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <configLocation>${basedir}/src/main/resources/checkstyle.xml</configLocation>
          <sourceDirectories>
            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
            <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
          </sourceDirectories>
          <skip>${skipTests}</skip>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.gaul</groupId>
        <artifactId>modernizer-maven-plugin</artifactId>
        <version>2.6.0</version>
        <configuration>
          <javaVersion>${targetJdk}</javaVersion>
        </configuration>
        <executions>
          <execution>
            <id>modernizer-check</id>
            <phase>verify</phase>
            <goals>
              <goal>modernizer</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.15</version>
        <configuration>
          <excludes>
            <exclude>**/nbactions.xml</exclude>
            <exclude>**/nb-configuration.xml</exclude>
            <exclude>**/META-INF/cxf/**</exclude>
            <exclude>**/META-INF/services/**</exclude>
            <exclude>**/META-INF/MANIFEST.MF</exclude>            
            <exclude>**/*.csv</exclude>
            <exclude>**/archetype-resources/**</exclude>
            <exclude>**/AdminLTE*/**</exclude>
            <exclude>**/goal.txt</exclude>
            <exclude>**/rat.txt</exclude>
            <exclude>**/build-copy-javadoc-files.xml</exclude>
            <exclude>**/maven-eclipse.xml</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/*.log</exclude>
            <exclude>**/.externalToolBuilders/**</exclude>
            <exclude>.git/**</exclude>
            <exclude>.idea/**</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/.*</exclude>
            <exclude>**/deb/control/conffiles</exclude>
            <exclude>**/deb/control/control</exclude>
            <exclude>**/*.lst</exclude>
            <exclude>**/*.json</exclude>
            <exclude>**/banner.txt</exclude>
            <exclude>**/target/**</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>rat-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Put NOTICE and LICENSE files in all artifacts and javadocs -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>copy-artifact-legal-files</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/classes/META-INF</outputDirectory>
              <resources>
                <resource>
                  <directory>.</directory>
                  <includes>
                    <include>LICENSE</include>
                    <include>NOTICE</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-javadoc-legal-files</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/apidocs/META-INF</outputDirectory>
              <resources>
                <resource>
                  <directory>.</directory>
                  <includes>
                    <include>LICENSE</include>
                    <include>NOTICE</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <appendAssemblyId>true</appendAssemblyId>
          <descriptors>
            <descriptor>src/assemble/connector.xml</descriptor>
          </descriptors>
          <archive>
            <index>true</index>
            <manifestEntries>
              <ConnectorBundle-FrameworkVersion>${connid.version}</ConnectorBundle-FrameworkVersion>
              <ConnectorBundle-Name>${project.artifactId}</ConnectorBundle-Name>
              <ConnectorBundle-Version>${project.version}</ConnectorBundle-Version>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>   
    
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>.</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>it</id>

      <build>
        <defaultGoal>clean verify</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <skip>true</skip>
            </configuration>
            <executions>
              <execution>
                <id>test-phase-execution</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                  <includes>
                    <include>**/*Tests.java</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
