<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <artifactId>de.acosix.alfresco.keycloak.parent</artifactId>
    <groupId>de.acosix.alfresco.keycloak</groupId>
    <version>1.2.0-rc1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>de.acosix.alfresco.keycloak.repo</artifactId>
  <name>Acosix Alfresco Keycloak - Repository Module</name>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <configuration>
            <classifier>sources-unshaded</classifier>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
              <configuration>
                <createSourcesJar>true</createSourcesJar>
                <shadeSourcesContent>true</shadeSourcesContent>
                <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
                <artifactSet>
                  <includes>
                    <include>org.keycloak:*</include>
                    <include>org.jboss.logging:*</include>
                  </includes>
                </artifactSet>
                <relocations>
                  <relocation>
                    <pattern>org.keycloak</pattern>
                    <shadedPattern>de.acosix.alfresco.keycloak.deps.keycloak</shadedPattern>
                  </relocation>
                  <relocation>
                    <pattern>org.jboss.logging</pattern>
                    <shadedPattern>de.acosix.alfresco.keycloak.deps.jboss.logging</shadedPattern>
                  </relocation>
                </relocations>
                <transformers>
                  <transformer />
                  <transformer />
                  <transformer>
                    <addHeader>false</addHeader>
                  </transformer>
                </transformers>
                <filters>
                  <filter>
                    <artifact>org.keycloak:*</artifact>
                    <excludes>
                      <exclude>META-INF/MANIFEST.MF</exclude>
                    </excludes>
                  </filter>
                  <filter>
                    <artifact>org.jboss.logging:*</artifact>
                    <excludes>
                      <exclude>META-INF/MANIFEST.MF</exclude>
                    </excludes>
                  </filter>
                </filters>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>unpack-shaded-jar</id>
              <phase>package</phase>
              <goals>
                <goal>unpack</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>${project.artifactId}</artifactId>
                    <version>${project.version}</version>
                  </artifactItem>
                </artifactItems>
                <outputDirectory>${project.build.outputDirectory}</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>de.thetaphi</groupId>
          <artifactId>forbiddenapis</artifactId>
          <configuration>
            <excludes>
              <exclude>de/acosix/alfresco/keycloak/deps/**/*.class</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <configuration>
            <onlyAnalyze>de.acosix.alfresco.keycloak.repo.*</onlyAnalyze>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.alfresco</groupId>
      <artifactId>alfresco-remote-api</artifactId>
      <version>23.1.0.255</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.keycloak</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <version>5.0.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
