<?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>ru.i-novus.messaging</groupId>
        <artifactId>messaging-pom</artifactId>
        <version>4.1.3</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>messaging-admin-frontend</artifactId>

    <properties>
        <jaxws.version>2.3.2</jaxws.version>
        <maven.deploy.skip>true</maven.deploy.skip>
        <backend.default.path>http://localhost:8080/api</backend.default.path>
        <config.server.enable>false</config.server.enable>
        <jacoco.skip>false</jacoco.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>ru.i-novus.ms.audit</groupId>
            <artifactId>audit-client-async-spring-boot-starter</artifactId>
            <version>${audit.version}</version>
        </dependency>
        <dependency>
            <groupId>ru.i-novus.ms.audit</groupId>
            <artifactId>audit-client-spring-boot-autoconfigure</artifactId>
            <version>${audit.version}</version>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.framework</groupId>
            <artifactId>n2o-spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>ru.i-novus.messaging</groupId>
            <artifactId>messaging-admin-web</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.framework.security</groupId>
            <artifactId>security-auth</artifactId>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.framework.security</groupId>
            <artifactId>security-auth-common</artifactId>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.framework.security</groupId>
            <artifactId>security-admin-rest-client</artifactId>
        </dependency>


        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-config</artifactId>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.platform</groupId>
            <artifactId>n2o-platform-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>net.n2oapp.platform</groupId>
            <artifactId>n2o-platform-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>rt</artifactId>
            <version>${jaxws.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-openid</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <finalName>messaging-admin-frontend</finalName>

        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>Copy frontend build</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/classes/public</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>../messaging-react/build</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>
    <profiles>
        <profile>
            <id>production</id>
            <properties>
                <config.server.enable>true</config.server.enable>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
        </profile>
    </profiles>

</project>
