<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.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>61</version>
    </parent>
    <groupId>net.e175.klaus</groupId>
    <artifactId>solarpositioning</artifactId>
    <version>2.0.4</version>
    <packaging>jar</packaging>
    <name>solarpositioning</name>

    <description>Algorithms for finding the sun's position on the sky, as well as sunrise and sunset times, for a
        given date and coordinates (latitude/longitude).
    </description>
    <url>https://github.com/klausbrunner/solarpositioning</url>
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://spdx.org/licenses/MIT.html</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Klaus Brunner</name>
            <url>https://github.com/klausbrunner</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:klausbrunner/solarpositioning.git</connection>
        <developerConnection>scm:git:git@github.com:klausbrunner/solarpositioning.git</developerConnection>
        <url>https://github.com/klausbrunner/solarpositioning/tree/${project.scm.tag}</url>
        <tag>v2.0.4</tag>
    </scm>

    <properties>
        <project.build.targetJdk>17</project.build.targetJdk>
        <maven.compiler.release>17</maven.compiler.release>

        <basepom.check.skip-license>true</basepom.check.skip-license>
        <basepom.check.skip-checkstyle>true</basepom.check.skip-checkstyle>
        <basepom.check.skip-dependency>true</basepom.check.skip-dependency>

        <basepom.release.profiles>basepom.central-release</basepom.release.profiles>
        <scmCommentPrefix>build: [maven-release-plugin] [skip ci]</scmCommentPrefix>
        <basepom.release.tag-name-format>v@{project.version}</basepom.release.tag-name-format>

        <basepom.nexus-staging.staging-url>https://oss.sonatype.org/</basepom.nexus-staging.staging-url>
        <basepom.nexus-staging.release-after-close>true</basepom.nexus-staging.release-after-close>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.7.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <autoPublish>true</autoPublish>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.spotify.fmt</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.25</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>6.0.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-SymbolicName>${project.artifactId}-osgi</Bundle-SymbolicName>
                        <Export-Package>net.e175.klaus.solarpositioning.*</Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>makeAggregateBom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.12.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.27.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>basepom.central-release</id>
            <properties>
                <!-- tests have been run in the preparation step of the release -->
                <basepom.test.skip>true</basepom.test.skip>
                <basepom.it.skip>true</basepom.it.skip>

                <!-- checks have been run in the preparation step of the release -->
                <basepom.check.skip-all>true</basepom.check.skip-all>

                <!-- oss requires a javadoc jar. Build one when releasing. -->
                <basepom.javadoc.skip>false</basepom.javadoc.skip>

                <!-- skip the deploy plugin, this is using the nexus OSS plugin -->
                <basepom.deploy.skip>true</basepom.deploy.skip>

                <!-- do not use the nexus oss plugin -->
                <basepom.nexus-staging.skip>true</basepom.nexus-staging.skip>
            </properties>
            <build>
                <plugins>
                    <!-- Sign artifacts using gpg for oss upload -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>basepom.release.default</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>basepom.release.default</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>publish</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
