<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH
  ~
  ~ See the AUTHORS file(s) distributed with this work for additional
  ~ information regarding authorship.
  ~
  ~ This Source Code Form is subject to the terms of the Mozilla Public
  ~ License, v. 2.0. If a copy of the MPL was not distributed with this
  ~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
  ~
  ~ SPDX-License-Identifier: MPL-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>io.openmanufacturing</groupId>
        <artifactId>sds-sdk-parent</artifactId>
        <version>1.0.1</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>sds-aspect-meta-model-java</artifactId>
    <name>SDS Aspect Meta Model Java</name>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>io.openmanufacturing</groupId>
            <artifactId>sds-aspect-model-resolver</artifactId>
        </dependency>
        <dependency>
            <groupId>io.openmanufacturing</groupId>
            <artifactId>sds-aspect-meta-model-resolver</artifactId>
        </dependency>
        <dependency>
            <groupId>io.openmanufacturing</groupId>
            <artifactId>sds-aspect-meta-model</artifactId>
        </dependency>
        <dependency>
            <groupId>io.openmanufacturing</groupId>
            <artifactId>sds-aspect-meta-model-types</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mozilla</groupId>
            <artifactId>rhino</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.openmanufacturing</groupId>
            <artifactId>sds-test-resources</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Disable surefire report plugin. The report is created in the sds-sdk-test-report module -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${maven-surefire-report-plugin-version}</version>
                <configuration>
                    <skipFailsafeReport>true</skipFailsafeReport>
                    <skipSurefireReport>true</skipSurefireReport>
                </configuration>
            </plugin>

            <!-- Disable maven site plugin. It is not required since the report is created in the
            sds-sdk-test-report module -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin-version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <version>${groovy-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <id>generate-unit-java</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>${project.basedir}/buildSrc/main/groovy/unit2java.groovy</source>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-unit-js</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>${project.basedir}/buildSrc/main/groovy/unit2js.groovy</source>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.jena</groupId>
                        <artifactId>jena-arq</artifactId>
                        <version>${jena-version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jena</groupId>
                        <artifactId>jena-core</artifactId>
                        <version>${jena-version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.openmanufacturing</groupId>
                        <artifactId>sds-aspect-meta-model</artifactId>
                        <version>${aspect-meta-model-version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                        <version>${guava-version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.github.javaparser</groupId>
                        <artifactId>javaparser-symbol-solver-core</artifactId>
                        <version>${javaparser-version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${project.basedir}/src-gen</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src-gen/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-resource</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src-gen/main/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
