<?xml version="1.0" encoding="UTF-8"?>
<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>de.vwsoft</groupId>
    <artifactId>barcodelib4j</artifactId>
    <version>2.0.2</version>
    <packaging>jar</packaging>

    <name>Barcode-Lib4J</name>
    <description>Barcode generation library for Java. Supports EAN, UPC, GS1-128, QR Code, DataMatrix and other 1D/2D barcodes. Renders to Graphics2D or exports barcodes as vector graphics (SVG, PDF, EPS) or raster images (PNG, BMP, JPEG).</description>
    <url>https://www.vw-software.com/java-barcode-library/</url>

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

    <developers>
        <developer>
            <name>Viktor Wedel</name>
            <organization>VW Software</organization>
            <organizationUrl>https://www.vw-software.com/</organizationUrl>
            <url>https://github.com/vws-java/</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/vws-java/Barcode-Lib4J.git</connection>
        <developerConnection>scm:git:https://github.com/vws-java/Barcode-Lib4J.git</developerConnection>
        <url>https://github.com/vws-java/Barcode-Lib4J</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>9</maven.compiler.source>
        <maven.compiler.target>9</maven.compiler.target>
        <maven.compiler.release>9</maven.compiler.release>
    </properties>

    <dependencies>
        <!-- Optional dependency for PDF export functionality -->
        <dependency>
            <groupId>com.github.librepdf</groupId>
            <artifactId>openpdf</artifactId>
            <version>[1.3,)</version>
            <optional>true</optional>
        </dependency>
    </dependencies>



    <!-- Maven Central Plugins and Configuration -->
    <build>
        <plugins>
            <!-- Maven Compiler Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <release>9</release>
                </configuration>
            </plugin>

            <!-- Maven Source Plugin (required for Maven Central) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Maven Javadoc Plugin (required for Maven Central) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>9</source>
                    <detectJavaApiLink>false</detectJavaApiLink>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- Profile for release signing (activate only when publishing) -->
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- GPG Plugin for signing artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Central Publishing Plugin for Sonatype Central -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.4.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <tokenAuth>true</tokenAuth>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- Distribution Management for Sonatype Central -->
    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/api/v1/publisher</url>
        </repository>
    </distributionManagement>

</project>
