<?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>
    <parent>
        <groupId>com.hibegin</groupId>
        <artifactId>zrlog-blog-web-parent</artifactId>
        <version>3.3.9</version>
    </parent>
    <name>ZrLog Blog web</name>

    <properties>
        <finalName>zrlog-blog-web</finalName>
        <libOutputPath>lib</libOutputPath>
        <gpg.passphrase/>
    </properties>


    <artifactId>zrlog-blog-web</artifactId>
    <dependencies>
        <dependency>
            <groupId>com.hibegin</groupId>
            <artifactId>zrlog-freemarker-template</artifactId>
            <version>3.3.9</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.hibegin</groupId>
            <artifactId>zrlog-polyglot-template</artifactId>
            <version>3.3.9</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>jar</id>
            <build>
                <finalName>${finalName}-${project.version}</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>clean</id>
                                <phase>clean</phase>
                                <goals>
                                    <goal>clean</goal>
                                </goals>
                                <configuration>
                                    <filesets>
                                        <fileset>
                                            <directory>${libOutputPath}</directory>
                                        </fileset>
                                    </filesets>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-dependencies</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${libOutputPath}</outputDirectory>
                                    <overWriteReleases>false</overWriteReleases>
                                    <overWriteSnapshots>false</overWriteSnapshots>
                                    <overWriteIfNewer>true</overWriteIfNewer>
                                    <excludeArtifactIds>
                                        junit,hamcrest-core
                                    </excludeArtifactIds>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <finalName>${finalName}</finalName>
                            <classifier>starter</classifier>
                            <archive>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <classpathPrefix>${libOutputPath}</classpathPrefix>
                                    <mainClass>com.zrlog.blog.Application</mainClass>
                                </manifest>
                                <manifestEntries>
                                    <Class-Path>.</Class-Path>
                                </manifestEntries>
                            </archive>
                            <outputDirectory>./</outputDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>