<!--

    Copyright ©2023-2025 LogonBox Ltd
    All changes post March 2025 Copyright © 2023 JADAPTIVE Limited (support@jadaptive.com)

    Permission is hereby granted, free of charge, to any person obtaining a copy of this
    software and associated documentation files (the “Software”), to deal in the Software
    without restriction, including without limitation the rights to use, copy, modify,
    merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to the following
    conditions:

    The above copyright notice and this permission notice shall be included in all copies
    or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
    INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jadaptive</groupId>
    <artifactId>nodal-core</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <name>Nodal Core</name>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <native.image.annotations.version>0.9.3</native.image.annotations.version>
        <dbus.version>5.1.0</dbus.version>
        <graalvm.version>0.9.28</graalvm.version>
		<build.projectProperties>${basedir}/jadaptive.build.properties</build.projectProperties>
		<build.userProperties>${user.home}/.jadaptive.build.properties</build.userProperties>
		<build.quietProperties>true</build.quietProperties>
    </properties>
    <modules>
        <module>lib</module>
        <module>linux</module>
        <module>windows</module>
        <module>macos</module>
        <module>remote</module>
        <module>tools</module>
        <module>dll</module>
    </modules>
    <developers>
        <developer>
            <id>brett</id>
            <email>developers@logonbox.com</email>
        </developer>
    </developers>
    <organization>
        <name>JADAPTIVE</name>
        <url>https://jadaptive.com</url>
    </organization>
    <inceptionYear>2023</inceptionYear>
    <url>https://github.com/Nodal-VPN/nodal-core</url>
    <description>
        Java interface to Wireguard.
    </description>
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://mit-license.org/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/Nodal-VPN/nodal-core</url>
        <connection>scm:git:https://github.com/Nodal-VPN/nodal-core.git</connection>
    </scm>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.9.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.co.bithatch</groupId>
            <artifactId>native-image-annotations</artifactId>
            <version>${native.image.annotations.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
	    <dependencies>
	        <dependency>
	            <groupId>com.sshtools</groupId>
	            <artifactId>jini-lib</artifactId>
	            <version>0.6.0</version>
	        </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.9</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.9</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>2.0.9</version>
            </dependency>
			<dependency>
				<groupId>com.github.hypfvieh</groupId>
				<artifactId>dbus-java-core</artifactId>
				<version>${dbus.version}</version>
			</dependency>
            <dependency>
                <groupId>com.github.hypfvieh</groupId>
                <artifactId>dbus-java-transport-native-unixsocket</artifactId>
				<version>${dbus.version}</version>
            </dependency>
	    </dependencies>
	</dependencyManagement>
    <build>
        <plugins>
            
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>initialize</phase>
						<goals>
							<goal>read-project-properties</goal>
						</goals>
						<configuration>
							<quiet>${build.quietProperties}</quiet>
							<files>
								<file>${build.projectProperties}</file>
								<file>${build.userProperties}</file>
							</files>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
			</plugin>
        
        
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                	<release>17</release>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>uk.co.bithatch</groupId>
                            <artifactId>native-image-annotations</artifactId>
                            <version>${native.image.annotations.version}</version>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
			<!-- <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>-->
            
            
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
            </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.8.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central-jadaptive</publishingServerId>
                         <autoPublish>true</autoPublish>
                         <waitUntil>published</waitUntil>
                    </configuration>
                </plugin>
				<plugin>
					<groupId>net.jsign</groupId>
					<artifactId>jsign-maven-plugin</artifactId>
					<version>7.2</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>properties-maven-plugin</artifactId>
					<version>1.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                </plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <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>
                        <encoding>UTF-8</encoding>
                        <detectJavaApiLink>false</detectJavaApiLink>
                        <source>17</source>
                        <doclint>none</doclint>
                        <sourcepath>src/main/java</sourcepath>
                        <includeDependencySources>false</includeDependencySources>
                        <dependencySourceIncludes>
                            <dependencySourceInclude>com.sshtools:*</dependencySourceInclude>
                        </dependencySourceIncludes>
                    </configuration>
                </plugin>
                <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>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <header>src/templates/MIT.txt</header>
                        <properties>
                            <owner>JADAPTIVE Limited</owner>
                            <email>support@jadaptive.com</email>
                        </properties>
                        <excludes>
                            <exclude>**/README</exclude>
                            <exclude>src/test/resources/**</exclude>
                            <exclude>src/main/resources/**</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                                <goal>format</goal>
                                <goal>remove</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.graalvm.buildtools</groupId>
                    <artifactId>native-maven-plugin</artifactId>
                    <version>${graalvm.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <!-- Graal Native Image -->
        <profile>
            <id>quick-build</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>lbvdll</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <buildArgs>
                                        <buildArg>-Ob</buildArg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>instrument</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>lbvdll</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <buildArgs>
                                        <buildArg>--pgo-instrument</buildArg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>instrumented</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>lbvdll</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <buildArgs>
                                        <buildArg>--pgo=${basedir}/default.iprof</buildArg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>compatibility</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>lbvdll</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <buildArgs>
                                        <buildArg>-march=compatibility</buildArg>
                                    </buildArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
    
    <repositories>
        <repository>
            <id>oss-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots</url>
            <snapshots />
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    
</project>
