<?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>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.4</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>edu.iu.uits.lms</groupId>
    <artifactId>lms-canvas-rivet</artifactId>
    <packaging>jar</packaging>
    <name>lms-canvas-rivet</name>
    <version>5.2.5.2</version>
    <description>A webjars style bundle that contains rivet and rivet-related libraries that can be used in other projects</description>
    <url>https://github.com/indiana-university/lms-canvas-rivet</url>
    <inceptionYear>2015</inceptionYear>

    <organization>
        <name>Indiana University</name>
        <url>https://iu.edu</url>
    </organization>

    <developers>
        <developer>
            <name>Learning Management Systems Team</name>
            <email>lmsreq@iu.edu</email>
            <organization>Indiana University</organization>
            <organizationUrl>https://iu.edu</organizationUrl>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/indiana-university/lms-canvas-rivet/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>BSD 3-Clause License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <distributionManagement>
        <repository>
            <name>Sonatype OSS Repository</name>
            <id>Sonatype-OSS</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <name>Sonatype OSS Snapshot Repository</name>
            <id>Sonatype-OSS</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:https://github.com/indiana-university/lms-canvas-rivet.git</connection>
        <developerConnection>scm:git:https://github.com/indiana-university/lms-canvas-rivet.git</developerConnection>
        <url>https://github.com/indiana-university/lms-canvas-rivet</url>
        <tag>lms-canvas-rivet-5.2.5.2</tag>
    </scm>

    <properties>
        <frontend-maven-plugin.version>1.12.0</frontend-maven-plugin.version>
        <java.version>11</java.version>
        <jdk.source>11</jdk.source>
        <jdk.target>11</jdk.target>
        <nodejs.version>v14.17.6</nodejs.version>
        <npm.version>6.14.15</npm.version>
        <plugins.compiler.version>3.8.1</plugins.compiler.version>
        <plugins.gpg.version>1.6</plugins.gpg.version>
        <plugins.javadoc.version>3.0.1</plugins.javadoc.version>
        <plugins.license.version>2.0.0</plugins.license.version>
        <plugins.nexus-staging.version>1.6.8</plugins.nexus-staging.version>
        <plugins.release.version>2.5.3</plugins.release.version>
        <plugins.source.version>3.0.1</plugins.source.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <nodeVersion>${nodejs.version}</nodeVersion>
                    <npmVersion>${npm.version}</npmVersion>
                    <installDirectory>${project.build.directory}/js</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>js-install-node-and-npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                    <execution>
                        <id>js-process</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>js-package</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>webpack</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${plugins.compiler.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${plugins.license.version}</version>
                <configuration>
                    <licenseName>bsd_3</licenseName>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <excludes>
                        <exclude>**/redis.properties</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${plugins.nexus-staging.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>Sonatype-OSS</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${plugins.release.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${plugins.source.version}</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>${plugins.javadoc.version}</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>${plugins.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
