<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.kie.kogito</groupId>
        <artifactId>kogito-api-parent</artifactId>
        <version>1.37.0.Final</version>
    </parent>

    <artifactId>kogito-api-incubation-common-objectmapper</artifactId>
    <packaging>jar</packaging>

    <name>Kogito :: API :: Public API :: Incubation :: Common Object Mapper</name>
    <description>The Kogito Public Common API (Incubation).</description>

    <properties>
        <java.module.name>org.kie.kogito.api.incubation.common.mapper</java.module.name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>de.skuzzle.enforcer</groupId>
                        <artifactId>restrict-imports-enforcer-rule</artifactId>
                        <version>${version.de.skuzzle.enforcer}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>check-restricted-imports</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
                                    <reason>Allow only module imports</reason>
                                    <bannedImports>
                                        <bannedImport>org.kie.kogito.**</bannedImport>
                                    </bannedImports>
                                    <allowedImports>
                                        <!-- we always allow process.* as these will be movable to internal -->
                                        <allowedImport>org.kie.kogito.incubation.common.objectmapper.**</allowedImport>
                                    </allowedImports>
                                </restrictImports>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
