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

    Copyright (C) 2020 Tirasa (info@tirasa.net)

    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>

  <name>Apache Syncope: Wicket Enduser</name>
  <description>Apache Syncope Enduser UI built with Apache Wicket</description>
  <groupId>net.tirasa.syncope</groupId>
  <artifactId>syncope-wicket-enduser</artifactId>
  <version>2.1.10.0</version>
  <packaging>pom</packaging>

  <url>http://syncope.tirasa.net</url>
  <inceptionYear>2020</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/syncope-wicket-enduser.git</connection>
    <url>scm:git:git@github.com:Tirasa/syncope-wicket-enduser.git</url>
    <developerConnection>scm:git:git@github.com:Tirasa/syncope-wicket-enduser.git</developerConnection>
    <tag>syncope-wicket-enduser-2.1.10.0</tag>
  </scm>

  <issueManagement>
    <system>Github Issue</system>
    <url>https://github.com/Tirasa/syncope-wicket-enduser/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Workflow</system>
    <url>https://github.com/Tirasa/syncope-wicket-enduser/actions</url>
  </ciManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <developers>
    <developer>
      <id>ilgrosso</id>
      <email>ilgrosso@apache.org</email>
      <name>Francesco Chicchiriccò</name>
      <organization>Tirasa</organization>
      <organizationUrl>http://www.tirasa.net/</organizationUrl>
      <url>https://home.apache.org/~ilgrosso/</url>
    </developer>
    <developer>
      <id>mdisabatino</id>
      <email>mdisabatino@apache.org</email>
      <name>Marco Di Sabatino Di Diodoro</name>
      <organization>Tirasa</organization>
      <organizationUrl>http://www.tirasa.net/</organizationUrl>
      <url>https://home.apache.org/~mdisabatino/</url>
    </developer>
    <developer>
      <id>loredicola</id>
      <email>loredicola@apache.org</email>
      <name>Lorenzo Di Cola</name>
      <organization>Tirasa</organization>
      <organizationUrl>http://www.tirasa.net/</organizationUrl>
      <url>https://home.apache.org/~andreapatricelli/</url>
    </developer>
    <developer>
      <id>andreapatricelli</id>
      <email>andreapatricelli@apache.org</email>
      <name>Andrea Patricelli</name>
      <organization>Tirasa</organization>
      <organizationUrl>http://www.tirasa.net/</organizationUrl>
      <url>https://home.apache.org/~andreapatricelli/</url>
    </developer>
  </developers>

  <properties>
    <syncope.version>2.1.10</syncope.version>

    <bootbox.version>5.4.0</bootbox.version>
    <font-awesome.version>4.7.0</font-awesome.version>
    <font-awesome.filename>font-awesome.min.css</font-awesome.filename>
    <ionicons.version>2.0.1</ionicons.version>
    <jquery-slimscroll.version>1.3.8</jquery-slimscroll.version>

    <cargo.log>${log.directory}/cargo.log</cargo.log>
    <cargo.output>${log.directory}/cargo-output.log</cargo.output>
    <tomcat.version>9.0.39</tomcat.version>

    <conf.directory>${project.build.directory}/test-classes</conf.directory>
    <log.directory>${project.build.directory}/log</log.directory>
    <anonymousUser>anonymous</anonymousUser>
    <anonymousKey>anonymousKey</anonymousKey>

    <targetJdk>1.8</targetJdk>
    <rootpom.basedir>${basedir}</rootpom.basedir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.syncope</groupId>
        <artifactId>syncope</artifactId>
        <version>${syncope.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>    
  </dependencyManagement>

  <build>
    <defaultGoal>clean verify</defaultGoal>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version> 
          <configuration>
            <source>${targetJdk}</source>
            <target>${targetJdk}</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.1.1</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>8.36.2</version>
            </dependency>
          </dependencies>
          <configuration>
            <configLocation>${rootpom.basedir}/src/main/resources/org/apache/syncope/checkstyle.xml</configLocation>
            <targetJdk>${targetJdk}</targetJdk>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>          
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
            <encoding>utf-8</encoding>
            <runOrder>alphabetical</runOrder>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
            <encoding>utf-8</encoding>
            <runOrder>alphabetical</runOrder>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Psonatype-oss-release</arguments>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
      <plugin>
        <groupId>org.gaul</groupId>
        <artifactId>modernizer-maven-plugin</artifactId>
        <version>2.0.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.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <resourceExcludes>**/LICENSE,**/NOTICE</resourceExcludes>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.13</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>**/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.1.0</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>${rootpom.basedir}</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>${rootpom.basedir}</directory>
                  <includes>
                    <include>LICENSE</include>
                    <include>NOTICE</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>ianal-maven-plugin</artifactId>
        <version>1.0-alpha-1</version>
        <executions>
          <execution>
            <goals>
              <goal>verify-legal-files</goal>
            </goals>
            <configuration>
              <!-- Fail the build if any artifacts are missing legal files -->
              <strict>true</strict>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>syncope-wicket-enduser-@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>.</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>

      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>          
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>${rootpom.basedir}/LICENSE</include>
                    <include>${rootpom.basedir}/NOTICE</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>    
  </profiles>

  <repositories>
    <repository>
      <id>apache.snapshots</id>
      <url>https://repository.apache.org/content/repositories/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <modules>
    <module>common-ui</module>
    <module>app</module>
    <module>ext</module>
    <module>docker</module>
  </modules> 
</project>
