<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
 Copyright (c) 2025 PANTHEON.tech, s.r.o. and others.  All rights reserved.

 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
 and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<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>org.opendaylight.controller</groupId>
        <artifactId>bnd-parent</artifactId>
        <version>12.0.2</version>
        <relativePath>../../bnd-parent/pom.xml</relativePath>
    </parent>

    <artifactId>scala3-library</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
    <description>Scala 3 library repackaged for OpenDaylight</description>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <properties>
        <!-- We are just juggling classes here -->
        <odlparent.modernizer.skip>true</odlparent.modernizer.skip>
        <odlparent.spotbugs.skip>true</odlparent.spotbugs.skip>

        <!-- We do not want to generate javadoc -->
        <maven.javadoc.skip>true</maven.javadoc.skip>

        <!-- Used in bnd.bnd -->
        <scala3.library.version>3.3.6</scala3.library.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.13.16</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala3-library_3</artifactId>
            <version>${scala3.library.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-license</id>
                        <configuration>
                            <!-- Scala is Apache-2.0 licensed -->
                            <skip>true</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <classifier>sources</classifier>
                            <includeArtifactIds>scala-library,scala3-library_3</includeArtifactIds>
                            <outputDirectory>${project.build.directory}/shaded-sources</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-javadoc</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                            <includeArtifactIds>scala3-library_3</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>shaded-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>${project.build.directory}/shaded-sources</sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>shaded-javadoc</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/dependency/scala3-library_3-javadoc.jar</file>
                                    <type>jar</type>
                                    <classifier>javadoc</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
