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

    Copyright (C) 2011 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.ad</artifactId>
  <version>1.3.9</version>

  <name>ConnId Bundles: AD</name>

  <packaging>jar</packaging>

  <url>http://connid.tirasa.net</url>
  <inceptionYear>2011</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/ConnIdADBundle.git</connection>
    <url>scm:git:git@github.com:Tirasa/ConnIdADBundle.git</url>
    <developerConnection>scm:git:git@github.com:Tirasa/ConnIdADBundle.git</developerConnection>
    <tag>net.tirasa.connid.bundles.ad-1.3.9</tag>
  </scm>
  
  <issueManagement>
    <system>jira</system>
    <url>https://connid.atlassian.net/browse/AD</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Workflow</system>
    <url>https://github.com/Tirasa/ConnIdADBundle/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>
    <connid.ldap.version>1.5.7</connid.ldap.version>
    <adsddl.verson>1.9</adsddl.verson>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
    <exec.skip>false</exec.skip>
  </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>net.tirasa.connid.bundles</groupId>
      <artifactId>net.tirasa.connid.bundles.ldap</artifactId>
      <version>${connid.ldap.version}</version>
    </dependency>
    
    <dependency>
      <groupId>net.tirasa</groupId>
      <artifactId>adsddl</artifactId>
      <version>${adsddl.verson}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- TEST -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <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-resources-plugin</artifactId>
        <inherited>true</inherited>        
        <executions>
          <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>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>true</skip>
        </configuration>
      </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>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>
            <exclude>**/*.ldif</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>rat-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </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>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.1.2</version>
        <configuration>
          <skipTests>${exec.skip}</skipTests>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <runOrder>alphabetical</runOrder>
        </configuration>
        <executions>
          <execution>
            <id>verify</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <skipTests>${exec.skip}</skipTests>
        </configuration>
        <executions>
          <execution>
            <id>test-phase-execution</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${exec.skip}</skip>
              <includes>
                <include>**/*Test.java</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.43.4</version>
        <configuration>
          <skip>${exec.skip}</skip>
          <images>
            <image>
              <alias>tirasaad</alias>
              <name>tirasaad</name>
              <build>
                <dockerFileDir>${basedir}/src/test/resources/docker/tirasaad</dockerFileDir>
              </build>
              <run>
                <privileged>true</privileged>
                <ports>
                  <port>636:636</port>
                </ports>
                <env>
                  <SMB_ADMIN_PASSWORD>Password321!</SMB_ADMIN_PASSWORD>
                </env>
                <log>
                  <date>default</date>
                  <color>yellow</color>
                  <enabled>false</enabled>
                </log>
                <containerNamePattern>%a</containerNamePattern>
                <volumes>
                  <bind>
                    <volume>${basedir}/src/test/resources/docker/tirasaad:/opt/ad-scripts</volume>
                  </bind>
                </volumes>
                <wait>
                  <log>samba version 4.15.13-Ubuntu started</log>
                  <time>60000</time>
                </wait>
              </run>
            </image>
          </images>
        </configuration>
        <executions>
          <execution>
            <id>build-docker</id>
            <phase>initialize</phase>
            <goals>
              <goal>stop</goal>
              <goal>remove</goal>
            </goals>
          </execution>
          <execution>
            <id>start-docker</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>build</goal>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>remove-containers-post-test</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
              <goal>remove</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>skipTests</id>
      
      <properties>
        <exec.skip>true</exec.skip>
      </properties>
      
      <build>
        <defaultGoal>clean install</defaultGoal>
      </build>
    </profile>
  </profiles>
  
  <repositories>
    <repository>
      <id>sonatype</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>atalassian</id>
      <url>https://maven.atlassian.com/3rdparty/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

</project>
