<!--

    Copyright (c) 2015 Bosch Software Innovations GmbH and others

    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>org.eclipse.hawkbit</groupId>
        <artifactId>hawkbit-parent</artifactId>
        <version>${revision}</version>
    </parent>

    <artifactId>hawkbit-test-report</artifactId>
    <name>hawkBit :: Test Report</name>

    <!-- enumerate all modules that should be included in the jacoco test report since it aggregates only direct dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-security-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-artifact-repository-filesystem</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-repository-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-repository-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-repository-jpa</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-autoconfigure</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-ddi-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-ddi-resource</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-ddi-security</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-mgmt-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-mgmt-resource</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-rest-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-dmf-amqp</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-dmf-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.hawkbit</groupId>
            <artifactId>hawkbit-update-server</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>generateTestReport</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>aggregate-reports</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report-aggregate</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.basedir}/../target/jacoco-aggregate</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/resources/assemblies/test-report.xml</descriptor>
                            </descriptors>
                            <appendAssemblyId>true</appendAssemblyId>
                        </configuration>
                        <executions>
                            <execution>
                                <id>create-report-zip-assembly</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
