﻿<?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>

    <!-- [2026-05-05] groupId ???? xyz.darra (Sonatype Central namespace ???, ?? OPCUA ?????????).
         artifactId = darra-ethercat-master, ?? NuGet Darra.EtherCAT.Master / Rust darra-ethercat-master ????
         (??? -sdk ???, Sonatype ?????��?? = groupId ??��?? + artifactId). -->
    <groupId>xyz.darra</groupId>
    <artifactId>darra-ethercat-master</artifactId>
    <version>2.7.0</version>
    <packaging>jar</packaging>

    <name>Darra EtherCAT Master Java SDK</name>
    <description>Commercial EtherCAT master protocol stack with real-time kernel driver integration, Windows and Linux support, multi-language SDKs, complex topology and hot-plug support.</description>
    <url>https://ethercat.darra.xyz</url>

    <!-- ??????? -->
    <licenses>
        <license>
            <name>Proprietary</name>
            <url>https://ethercat.darra.xyz/license</url>
            <distribution>repo</distribution>
            <comments>Darra Technology ???????</comments>
        </license>
    </licenses>

    <!-- ????????? -->
    <developers>
        <developer>
            <id>darra</id>
            <name>Darra Technology</name>
            <email>dev@darra.xyz</email>
            <organization>Darra Technology</organization>
            <organizationUrl>https://ethercat.darra.xyz</organizationUrl>
        </developer>
    </developers>

    <!-- ???????? (Sonatype ??????, ??????????, ??????????) -->
    <scm>
        <connection>scm:git:https://ethercat.darra.xyz/source.git</connection>
        <developerConnection>scm:git:https://ethercat.darra.xyz/source.git</developerConnection>
        <url>https://ethercat.darra.xyz</url>
    </scm>

    <!-- Maven Central ??????? -->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jna.version>5.14.0</jna.version>
        <!-- ProGuard ?�� -->
        <proguard.version>7.4.2</proguard.version>
        <!-- ???? GPG ??? (??????????? true) -->
        <gpg.skip>false</gpg.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>${jna.version}</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna-platform</artifactId>
            <version>${jna.version}</version>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>

        <!-- [2026-05-05 ??????] src/main/resources/win32-x86-64/Darra.Core.dll ??????? jar.
             ???: build ??? jar ?��?��??? / ��??? Darra.Core.dll = ????? IP ??????????.
             ????? pack ??��? 03_Signed/Core/Darra.Core.dll (VMP + EV ???) ??
             encrypt-03-sdk-java.ps1 ??? jar ?? META-INF/native/win-x64/ ?? win32-x86-64/.
             ????????????? (.gitkeep) ?? JNA loader ?????��??, ??????? .dll.
             ????? VMProtectSDK64.dll ???�ʦ�?????? dll. -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>win32-x86-64/**</include>
                    <include>linux-x86-64/**</include>
                </includes>
                <excludes>
                    <!-- ?��?????? Darra.Core.dll ??????? jar -->
                    <exclude>**/Darra.Core.dll</exclude>
                    <exclude>**/Darra.Core.pdb</exclude>
                    <exclude>**/libDarraCore.so</exclude>
                    <!-- VMProtect SDK helper ????? jar (?????????? Core.dll ????????) -->
                    <exclude>**/VMProtectSDK64.dll</exclude>
                    <exclude>**/VMProtectSDK.dll</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <!-- ????????? -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <!-- JAR ?????? -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Title>${project.name}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor>Darra Technology</Implementation-Vendor>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <!-- ??? JAR ??? (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>

            <!-- Javadoc JAR ??? (Maven Central ????) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <charset>UTF-8</charset>
                    <!-- ????????????��??????? -->
                    <doclint>none</doclint>
                    <source>11</source>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- GPG ?????? (Maven Central ????) -->
            <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>
                        <configuration>
                            <!-- GPG ??? ID, ???? settings.xml ?��??? -->
                            <keyname>${gpg.keyname}</keyname>
                            <!-- ??????? (???????????? -Dgpg.skip=true) -->
                            <skip>${gpg.skip}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- ProGuard ??????? -->
            <plugin>
                <groupId>com.github.wvengen</groupId>
                <artifactId>proguard-maven-plugin</artifactId>
                <version>2.6.1</version>
                <executions>
                    <execution>
                        <id>proguard-obfuscation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>proguard</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- ????? ProGuard ??????? -->
                    <proguardInclude>${project.basedir}/proguard-rules.pro</proguardInclude>
                    <!-- ???? JAR (???????? JAR) -->
                    <injar>${project.build.finalName}.jar</injar>
                    <!-- ??? JAR (??????) -->
                    <outjar>${project.build.finalName}-obfuscated.jar</outjar>
                    <!-- ????????? library jar
                         [2026-05-01] ?? java.xml (DocumentBuilderFactory ??) + java.logging (Logger)
                         JDK 9+ ??��, ? java.base ?????????? -->
                    <libs>
                        <lib>${java.home}/jmods/java.base.jmod</lib>
                        <lib>${java.home}/jmods/java.xml.jmod</lib>
                        <lib>${java.home}/jmods/java.logging.jmod</lib>
                        <lib>${java.home}/jmods/java.desktop.jmod</lib>
                    </libs>
                    <!-- ?????????????��?? -->
                    <mappingFileName>proguard-mapping.txt</mappingFileName>
                    <obfuscate>true</obfuscate>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.guardsquare</groupId>
                        <artifactId>proguard-base</artifactId>
                        <version>${proguard.version}</version>
                    </dependency>
                    <dependency>
                        <!-- [2026-05-01] proguard-core 9.x ?? proguard-base 7.4.x (?��?????) -->
                        <groupId>com.guardsquare</groupId>
                        <artifactId>proguard-core</artifactId>
                        <version>9.1.4</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Nexus Staging ??? (????????? Maven Central) -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <!-- ??? true ?????????; false ???????? -->
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <!-- ?????? -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- ???? Profile: mvn deploy -P release -->
        <profile>
            <id>release</id>
            <properties>
                <gpg.skip>false</gpg.skip>
            </properties>
        </profile>

        <!-- GraalVM Native Image Profile: mvn package -P native -->
        <profile>
            <id>native</id>
            <properties>
                <gpg.skip>true</gpg.skip>
            </properties>
            <build>
                <plugins>
                    <!-- ???? ProGuard (Native Image ?????????????) -->
                    <plugin>
                        <groupId>com.github.wvengen</groupId>
                        <artifactId>proguard-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>proguard-obfuscation</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GraalVM Native Image Maven ??? -->
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>0.10.1</version>
                        <extensions>true</extensions>
                        <executions>
                            <execution>
                                <id>build-native</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- ?????????? (DLL/SO) -->
                            <buildArgs>
                                <arg>--shared</arg>
                                <arg>--no-fallback</arg>
                                <arg>--initialize-at-build-time</arg>
                                <arg>-H:+ReportExceptionStackTraces</arg>
                                <arg>-H:ReflectionConfigurationFiles=${project.basedir}/native-image/reflection-config.json</arg>
                                <arg>-H:JNIConfigurationFiles=${project.basedir}/native-image/jni-config.json</arg>
                                <arg>-Djava.awt.headless=true</arg>
                            </buildArgs>
                            <imageName>darra-ethercat-native</imageName>
                            <!-- GraalVM ?????? -->
                            <mainClass>com.darra.ethercat.nativeimage.SubstrateConfig</mainClass>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <!-- GraalVM SDK (?????????) -->
                <dependency>
                    <groupId>org.graalvm.sdk</groupId>
                    <artifactId>graal-sdk</artifactId>
                    <version>23.1.2</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- ??????? Profile: ???????????? -->
        <profile>
            <id>dev</id>
            <properties>
                <gpg.skip>true</gpg.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.wvengen</groupId>
                        <artifactId>proguard-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>proguard-obfuscation</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
