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

    Copyright Cyril de Catheu, 2023

    Licensed under the JNOTEBOOK LICENSE 1.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at https://raw.githubusercontent.com/cyrilou242/jnotebook/main/LICENSE

    Unless required by applicable law or agreed to in writing, software distributed under the
    License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES 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>

    <groupId>tech.catheu</groupId>
    <artifactId>jnotebook</artifactId>
    <version>0.8.0</version>
    <packaging>pom</packaging>
    <name>jNotebook</name>
    <description>A notebook system for Java.</description>
    <url>https://github.com/cyrilou242/jnotebook/</url>
    <developers>
        <developer>
            <name>Cyril de Catheu</name>
            <email>cdecatheu@hey.com</email>
        </developer>
    </developers>
    <modules>
        <module>jnotebook-core</module>
        <module>jnotebook-distribution</module>
        <module>jnotebook-utils</module>
        <module>java-katex</module>
        <module>flexmark-ext-math</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <sonatype.url>https://s01.oss.sonatype.org</sonatype.url>

        <undertow.version>2.3.5.Final</undertow.version>
        <antlr.version>4.12.0</antlr.version>
        <flexmark.version>0.64.8</flexmark.version>
        <graalvm.js.version>22.3.2</graalvm.js.version>
    </properties>

    <!-- used by maven-release-plugin -->
    <scm>
        <url>https://github.com/cyrilou242/jnotebook.git</url>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <tag>jnotebook-0.8.0</tag>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>${sonatype.url}/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <name>Nexus Release Repository</name>
            <url>${sonatype.url}/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>tech.catheu</groupId>
                <artifactId>jnotebook-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.catheu</groupId>
                <artifactId>jnotebook-utils</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>tech.catheu</groupId>
                <artifactId>java-katex</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.catheu</groupId>
                <artifactId>flexmark-ext-math</artifactId>
                <version>${project.version}</version>
            </dependency>


            <dependency>
                <groupId>io.methvin</groupId>
                <artifactId>directory-watcher</artifactId>
                <version>0.18.0</version>
            </dependency>

            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-core</artifactId>
                <version>${undertow.version}</version>
            </dependency>

            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-servlet</artifactId>
                <version>${undertow.version}</version>
            </dependency>

            <dependency>
                <groupId>io.undertow</groupId>
                <artifactId>undertow-websockets-jsr</artifactId>
                <version>${undertow.version}</version>
            </dependency>

            <dependency>
                <groupId>org.thymeleaf</groupId>
                <artifactId>thymeleaf</artifactId>
                <version>3.1.1.RELEASE</version>
            </dependency>

            <dependency>
                <groupId>io.reactivex.rxjava3</groupId>
                <artifactId>rxjava</artifactId>
                <version>3.1.6</version>
            </dependency>

            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>4.7.1</version>
            </dependency>

            <dependency>
                <groupId>com.j2html</groupId>
                <artifactId>j2html</artifactId>
                <version>1.6.0</version>
            </dependency>

            <dependency>
                <groupId>fr.inria.gforge.spoon</groupId>
                <artifactId>spoon-core</artifactId>
                <version>10.3.0</version>
            </dependency>

            <dependency>
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark</artifactId>
                <version>${flexmark.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark-core</artifactId>
                <version>${flexmark.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark-ext-gitlab</artifactId>
                <version>${flexmark.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark-ext-footnotes</artifactId>
                <version>${flexmark.version}</version>
            </dependency>
            <dependency>
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark-ext-tables</artifactId>
                <version>${flexmark.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>31.0.1-jre</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.7</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.7</version>
            </dependency>


            <!-- javascript engine dependencies -->
            <dependency>
                <groupId>org.graalvm.js</groupId>
                <artifactId>js</artifactId>
                <version>${graalvm.js.version}</version>
            </dependency>
            <dependency>
                <groupId>org.graalvm.js</groupId>
                <artifactId>js-scriptengine</artifactId>
                <version>${graalvm.js.version}</version>
            </dependency>

            <!-- utils dependency -->
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>20230227</version>
            </dependency>
            <dependency>
                <groupId>com.microsoft.jfr</groupId>
                <artifactId>jfr-streaming</artifactId>
                <version>1.2.0</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>eclipse</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>
        <repository>
            <id>atlassian-public</id>
            <url>https://packages.atlassian.com/maven/repository/public</url>
        </repository>
    </repositories>

    <licenses>
        <license>
            <name>jNotebook license 1.0</name>
            <url>https://raw.githubusercontent.com/cyrilou242/jnotebook/main/LICENSE</url>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.2</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <header>HEADER</header>
                        <excludes>
                            <!-- Text and log files -->
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.log</exclude>
                            <exclude>**/*.list</exclude>
                            <exclude>**/*.out</exclude>
                            <exclude>**/*.generated</exclude>
                            <exclude>**/*.json</exclude>
                            <exclude>**/*.schema</exclude>

                            <!-- really executable java script -->
                            <exclude>**/cross_platform_exec.sh</exclude>

                            <!-- Binary files -->
                            <exclude>**/*.avro</exclude>
                            <exclude>**/*.avsc</exclude>
                            <exclude>**/*.csv</exclude>
                            <exclude>**/*.desc</exclude>
                            <exclude>**/*.parquet</exclude>
                            <exclude>**/*.gz</exclude>
                            <exclude>**/*.orc</exclude>
                            <exclude>**/*.dict</exclude>
                            <exclude>**/*.raw</exclude>
                            <exclude>**/*.mapping</exclude>
                            <exclude>**/*.ser</exclude>
                            <exclude>**/*.v1</exclude>
                            <exclude>**/*.v2</exclude>
                            <exclude>**/helm/**/charts/**</exclude>

                            <!-- Auto-generated files -->
                            <exclude>target/**</exclude>
                            <exclude>**/mem.script</exclude>
                            <exclude>**/mem.properties</exclude>
                            <exclude>**/m2/**</exclude>

                            <!-- Top level files -->
                            <exclude>HEADER</exclude>
                            <exclude>LICENSE</exclude>
                            <!-- files from Eclipse -->
                            <exclude>**/maven-eclipse.xml</exclude>
                            <exclude>.externalToolBuilders/**</exclude>
                            <!-- files from IntelliJ -->
                            <exclude>.idea/**</exclude>
                            <!-- tmp directories -->
                            <exclude>**/tmp/**</exclude>
                        </excludes>
                        <mapping>
                            <ts>JAVADOC_STYLE</ts>
                            <tsx>JAVADOC_STYLE</tsx>
                            <js>JAVADOC_STYLE</js>
                        </mapping>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.2.0</version>
                    <executions>
                        <execution>
                            <id>parse-versions-for-release</id>
                            <phase>initialize</phase>
                            <goals>
                                <goal>parse-version</goal>
                            </goals>
                            <configuration>
                                <propertyPrefix>parsedVersion</propertyPrefix>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M1</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <goals>deploy</goals>
                        <waitBeforeTagging>0</waitBeforeTagging>
                        <developmentVersion>
                            ${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0-SNAPSHOT
                        </developmentVersion>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>1.11.2</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-api</artifactId>
                            <version>1.11.2</version>
                        </dependency>
                    </dependencies>
                </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>${sonatype.url}</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.4</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                                <goal>create-metadata</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <configuration>
                                    <includePom>true</includePom>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.5.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-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
