<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>

    <groupId>org.metaeffekt.bundle.jsonschemafriend</groupId>
    <artifactId>ae-jsonschemafriend-bundle</artifactId>
    <version>0.12.5-1</version>

    <packaging>pom</packaging>

    <name>metaeffekt-jsonschemafriend-bundle</name>
    <description>Bundle for packaging and publishing jsonschemafriend on maven central.</description>
    <url>https://github.com/org-metaeffekt/jsonschemafriend</url>

    <organization>
        <name>metaeffekt GmbH</name>
        <url>https://metaeffekt.com</url>
    </organization>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <email>contact@metaeffekt.com</email>
            <organization>metaeffekt GmbH</organization>
            <organizationUrl>http://metaeffekt.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/org-metaeffekt/jsonschemafriend.git</connection>
        <developerConnection>scm:git:ssh://github.com/org-metaeffekt/jsonschemafriend.git</developerConnection>
        <url>https://github.com/org-metaeffekt/jsonschemafriend</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.jdk>1.8</maven.compiler.jdk>

        <!-- required for javadoc -->
        <organization>jimblackler/jsonschemafriend</organization>
        <license.identifier>Apache License 2.0</license.identifier>
        <license.file>/META-INF/LICENSE</license.file>
        <inception.year>2020</inception.year>
        <current.year>2025</current.year>

    </properties>

    <modules>
        <module>library</module>
    </modules>

    <dependencyManagement>
    </dependencyManagement>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <index>false</index>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifestEntries>
                            <Created-By>${organization}</Created-By>
                            <Built-By>${organization}</Built-By>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>License Information</name>
                                <manifestEntries>
                                    <License>${license.identifier}</License>
                                    <License-File>${license.file}</License-File>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.14</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <executable>gpg</executable>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>update-versions</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.metaeffekt.core</groupId>
                        <artifactId>ae-version-maven-plugin</artifactId>
                        <!-- version is fixed; core is not regarded a dependency -->
                        <version>0.135.10</version>
                        <configuration>
                            <propertyVersionMap>
                                <ae.jsonschemafriend.version>${ae.jsonschemafriend.version}</ae.jsonschemafriend.version>
                            </propertyVersionMap>
                            <projectVersion>${ae.jsonschemafriend.version}</projectVersion>
                            <groupIdVersionMap>
                                <org.metaeffekt.bundle.jsonschemafriend>${ae.jsonschemafriend.version}</org.metaeffekt.bundle.jsonschemafriend>
                            </groupIdVersionMap>
                            <includes>**/pom.xml</includes>
                            <excludes>**/.*/**/*</excludes>
                            <excludes>**/target/**/*</excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>pre-clean</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>generate-javadoc-jar</id>
            <activation>
                <file><exists>src/main/java</exists></file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <includePom>false</includePom>
                            <excludeResources>false</excludeResources>

                            <archive>
                                <index>false</index>
                                <addMavenDescriptor>false</addMavenDescriptor>
                                <manifestEntries>
                                    <Created-By>${organization}</Created-By>
                                    <Built-By>${organization}</Built-By>
                                </manifestEntries>
                                <manifestSections>
                                    <manifestSection>
                                        <name>License Information</name>
                                        <manifestEntries>
                                            <License>${license.identifier}</License>
                                            <License-File>${license.file}</License-File>
                                        </manifestEntries>
                                    </manifestSection>
                                </manifestSections>
                            </archive>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.10.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <source>8</source>
                            <javadocVersion>1.8</javadocVersion>
                            <show>public</show>
                            <failOnError>true</failOnError>

                            <additionalOptions>
                                <!-- disable specific checks (HTML) but keep others intact -->
                                <additionalOption>-Xdoclint:all,-html</additionalOption>
                            </additionalOptions>

                            <bottom>
                                Licensed under the ${license.identifier} - Copyright &#169; {inception.year} &#x2013;
                                {current.year} the original author or authors.
                            </bottom>
                            <archive>
                                <index>false</index>
                                <addMavenDescriptor>false</addMavenDescriptor>
                                <manifestEntries>
                                    <Created-By>${organization}</Created-By>
                                    <Built-By>${organization}</Built-By>
                                </manifestEntries>
                                <manifestSections>
                                    <manifestSection>
                                        <name>License Information</name>
                                        <manifestEntries>
                                            <License>${license.identifier}</License>
                                        </manifestEntries>
                                    </manifestSection>
                                </manifestSections>
                            </archive>
                            <excludes>
                                <exclude>**/*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
