<?xml version="1.0"?>
<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>
    <artifactId>jrds-standalone</artifactId>
    <name>JRDS standalone packaging</name>
    <url>http://jrds.fr</url>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jmx</artifactId>
            <version>${jetty.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-webapp</artifactId>
            <version>${jetty.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-http</artifactId>
            <version>${jetty.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-core</artifactId>
            <classifier>webapp</classifier>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-log4j</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-snmp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-ipmi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-jdbc</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-jsonp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-pcp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-munin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.jrds</groupId>
            <artifactId>jrds-core</artifactId>
            <classifier>webapp</classifier>
            <version>${project.version}</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>jrds-standalone-${project.version}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpackWebpApp</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>fr.jrds</groupId>
                                    <artifactId>jrds-webapp</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <outputDirectory>
                                        ${project.basedir}/target/webapp-unpacked/
                                    </outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>maven</name>
                            <value>true</value>
                        </property>
                        <property>
                            <name>jrds.testloglevel</name>
                            <value>error</value>
                        </property>
                        <property>
                            <name>jrds.snmpdirs</name>
                            <value>/usr/share/snmp/mibs</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <exclude>**/bootstrap</exclude>
                                <exclude>**/bootstrap/*</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>boot</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>boot</classifier>
                            <includes>
                                <include>**/bootstrap/*</include>
                            </includes>
                            <archive>
                                <manifest>
                                    <mainClass>jrds.bootstrap.BootStrap</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/distribution.xml</descriptor>
                    </descriptors>
                    <tarLongFileMode>posix</tarLongFileMode>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
    <scm>
        <url>https://github.com/fbacchella/jrds</url>
        <connection>scm:https://github.com/fbacchella/jrds.git</connection>
    </scm>
    <organization>
        <name>JRDS</name>
        <url>http://jrds.fr/</url>
    </organization>
    <developers>
        <developer>
            <id>fbacchella</id>
            <name>Fabrice Bacchella</name>
            <email>fbacchella@spamcop.net</email>
        </developer>
    </developers>
    <parent>
        <groupId>fr.jrds</groupId>
        <artifactId>jrds</artifactId>
        <version>2020.1</version>
    </parent>
</project>
