<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.xam.j2cl</groupId>
    <artifactId>slf4j2cl</artifactId>
    <version>0.1.0</version>
    <packaging>jar</packaging>
    <name>slf4j2cl</name>
    <description>XamDe's Simple Logging Facade (slf) for j2cl (Java to Closure Compiler).</description>
    <url>https://github.com/xamde/slf4j2cl</url>

    <licenses>
        <!-- slf4j is licensed as 'X11' according to the FAQ but the text is 1:1 the license text of MIT license -->
        <license>
            <name>MIT</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Dr. Max Völkel</name>
            <email>dev@xam.de</email>
            <organization>IT Consulting Dr. Max Völkel</organization>
            <organizationUrl>https://www.maxvoelkel.de</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/xamde/slf4j2cl.git</connection>
        <developerConnection>scm:git:git://github.com/xamde/slf4j2cl.git</developerConnection>
        <url>http://github.com/xamde/slf4j2cl/tree/main</url>
    </scm>

    <properties>
        <slf4j.version>1.7.36</slf4j.version>
        <j2cl-maven-plugin.version>0.19-SNAPSHOT</j2cl-maven-plugin.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <plugin.javadoc.version>3.2.0</plugin.javadoc.version>
        <plugin.sources.version>3.2.1</plugin.sources.version>
        <elemental2.version>1.1.0</elemental2.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.elemental2</groupId>
            <artifactId>elemental2-dom</artifactId>
            <version>${elemental2.version}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <!-- bundle sources with the jar, so they are visible to j2cl -->
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <testSource>1.8</testSource>
                    <testTarget>1.8</testTarget>
                    <compilerArgument>-Xlint</compilerArgument>
                    <!--
                    <compilerArgument>-Xlint:deprecation</compilerArgument>
                    <compilerArgument>-Xlint:removal</compilerArgument>
                    -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <source>8</source>
                    <linksource>true</linksource>
                    <doclint>none</doclint>
                    <links>
                        <link>https://docs.oracle.com/javase/8/docs/api/</link>
                    </links>
                    <doctitle><![CDATA[<h1>slf4j2cl ${project.version}</h1>]]></doctitle>
                    <bottom>
                        <![CDATA[<i>slf4j2cl ${project.version}.</i>]]></bottom>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.vertispan.j2cl</groupId>
                <artifactId>j2cl-maven-plugin</artifactId>
                <version>${j2cl-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>build-js</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <webappDirectory>${project.build.directory}/gwt/launcherDir</webappDirectory>
                    <compilationLevel>ADVANCED</compilationLevel>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <name>Central Repository OSSRH</name>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>vertispan-releases</id>
            <name>Vertispan hosted artifacts-releases</name>
            <url>https://repo.vertispan.com/j2cl</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <repositories>
        <repository>
            <id>vertispan-releases</id>
            <name>Vertispan hosted artifacts-releases</name>
            <url>https://repo.vertispan.com/j2cl</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>vertispan-snapshots</id>
            <name>Vertispan Snapshots</name>
            <url>https://repo.vertispan.com/gwt-snapshot/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <!--
    <distributionManagement>
        <repository>
            <id>github-slf4j2cl</id>
            <name>GitHub xamde Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/xamde/slf4j2cl</url>
        </repository>
    </distributionManagement>
    -->

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing
                                failed: Inappropriate ioctl for device -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>