<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.guicedee.services</groupId>
        <artifactId>services-parent</artifactId>
        <version>1.0.14.1</version>
    </parent>

    <artifactId>log4j-core</artifactId>

    <packaging>jar</packaging>
    <name>Apache Log4j2</name>
    <description>The Apache Log4j Implementation</description>

    <dependencies>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.13.3</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.13.3</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <version>2.13.3</version>
            <optional>true</optional>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jpl -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jpl</artifactId>
            <version>2.13.3</version>
            <optional>true</optional>
        </dependency>


        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>javax.jms-api</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>jakarta.mail</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>${jackson.version}</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>jakarta.activation</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>commons-compress</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.guicedee.services</groupId>
            <artifactId>commons-csv</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
            <version>1.18</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.jcabi</groupId>
            <artifactId>jcabi-log</artifactId>
            <version>0.18.1</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>jdk8</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>

                        <configuration>
                            <artifactSet>
                                <includes>
                                    <include>org.apache.logging.log4j:*</include>
                                    <include>org.fusesource.jansi:*</include>
                                    <include>org.jcabi:*</include>
                                    <include>com.jcabi:*</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                        <exclude>META-INF/versions/9/module-info.class</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer
                                        implementation="com.github.edwgiz.maven_shade_plugin.log4j2_cache_transformer.PluginsCacheFileTransformer">
                                </transformer>
                            </transformers>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.github.edwgiz</groupId>
                                <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
                                <version>2.13.3</version>
                            </dependency>
                            <dependency>
                                <groupId>org.ow2.asm</groupId>
                                <artifactId>asm</artifactId>
                                <version>${maven.asm.version}</version>
                                <type>jar</type>
                            </dependency>
                            <dependency>
                                <groupId>io.yupiik.maven</groupId>
                                <artifactId>maven-shade-transformers</artifactId>
                                <version>0.0.1</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.moditect</groupId>
                        <artifactId>moditect-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk9</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>

                        <configuration>
                            <artifactSet>
                                <includes>
                                    <include>org.apache.logging.log4j:*</include>
                                    <include>org.fusesource.jansi:*</include>
                                    <include>org.jcabi:*</include>
                                    <include>com.jcabi:*</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                        <exclude>META-INF/versions/9/module-info.class</exclude>
                                        <exclude>META-INF/services/*</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer
                                        implementation="com.github.edwgiz.maven_shade_plugin.log4j2_cache_transformer.PluginsCacheFileTransformer">
                                </transformer>
                            </transformers>
                            <relocations>
                                <relocation>
                                    <pattern>META-INF/versions/9/org</pattern>
                                    <shadedPattern>org</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.github.edwgiz</groupId>
                                <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
                                <version>2.13.3</version>
                            </dependency>
                            <dependency>
                                <groupId>org.ow2.asm</groupId>
                                <artifactId>asm</artifactId>
                                <version>${maven.asm.version}</version>
                                <type>jar</type>
                            </dependency>
                            <dependency>
                                <groupId>io.yupiik.maven</groupId>
                                <artifactId>maven-shade-transformers</artifactId>
                                <version>0.0.1</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.moditect</groupId>
                        <artifactId>moditect-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
