<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>
	<artifactId>push-sftp</artifactId>
	<parent>
		<groupId>com.sshtools</groupId>
		<version>0.1.1-SNAPSHOT</version>
		<artifactId>push-sftp-group</artifactId>
		<relativePath>..</relativePath>
	</parent>
	<properties>
		<!-- For exec:java -->
		<psftp.host>localhost</psftp.host>
		<psftp.user>${user.name}</psftp.user>
		<psftp.args>-X</psftp.args>
		<graalvm.version>21.2.0</graalvm.version>
		<main.class>com.sshtools.pushsftp.PSFTPInteractive</main.class>
		<synergy.version>3.1.0-SNAPSHOT</synergy.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>com.install4j</groupId>
			<artifactId>install4j-runtime</artifactId>
			<version>10.0.4</version>
			<!-- MUST be provided, the runtime is added by I4J itself -->
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>command-utils</artifactId>
			<version>1.1.1-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>maverick-synergy-client</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>maverick-bc</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>maverick-sshagent</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>maverick-sshagent-jdk16-sockets</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sshtools</groupId>
			<artifactId>maverick-sshagent-named-pipes</artifactId>
		</dependency>
	</dependencies>
	<dependencyManagement></dependencyManagement>
	<profiles>
		<!-- Graal Native Image -->
		<profile>
			<id>native-image</id>

			<distributionManagement>
				<!-- These are for the jars of natively compiled commands -->
				<repository>
					<id>libs-releases-local</id>
					<name>libs-releases</name>
					<url>https://artifactory.jadaptive.com/libs-releases-local</url>
				</repository>
				<snapshotRepository>
					<id>libs-snapshots-local</id>
					<name>libs-snapshots</name>
					<url>https://artifactory.jadaptive.com/libs-snapshots-local</url>
				</snapshotRepository>
			</distributionManagement>
			
			<dependencies>
				<dependency>
					<groupId>org.graalvm.sdk</groupId>
					<artifactId>graal-sdk</artifactId>
					<version>${graalvm.version}</version>
					<scope>provided</scope>
				</dependency>
				<dependency>
					<groupId>com.install4j</groupId>
					<artifactId>install4j-runtime</artifactId>
					<version>10.0.4</version>
				</dependency>
			</dependencies>
			
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<configuration>
									<target>
										<mkdir dir="${project.build.directory}/exe" />
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.graalvm.nativeimage</groupId>
						<artifactId>native-image-maven-plugin</artifactId>
						<version>${graalvm.version}</version>
						<executions>
							<execution>
								<id>push-sftp-native-image</id>
								<goals>
									<goal>native-image</goal>
								</goals>
								<phase>package</phase>
								<configuration>
									<outputDirectory>${project.build.directory}/exe</outputDirectory>
									<mainClass>${main.class}</mainClass>
									<skip>false</skip>
									<imageName>push-sftp</imageName>
									<buildArgs>--allow-incomplete-classpath
										--report-unsupported-elements-at-runtime
									</buildArgs>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<version>3.3.0</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<archive>
										<addMavenDescriptor>false</addMavenDescriptor>
										<forced>true</forced>
									</archive>
									<classifier>${build.platform}</classifier>
									<classesDirectory>${project.build.directory}/exe</classesDirectory>
									<includes>
										<include>push-sftp</include>
									</includes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>install4j-installers</id>
			<activation>
				<property>
					<name>buildInstaller</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<configuration>
									<target>
										<copy
											file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
											tofile="${project.build.directory}/${project.artifactId}.jar" />
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<configuration>
							<outputDirectory>
								${project.build.directory}/dependencies</outputDirectory>
						</configuration>
						<executions>
							<execution>
								<id>copy-dependencies</id>
								<phase>package</phase>
								<goals>
									<goal>copy-dependencies</goal>
								</goals>
								<configuration>
									<outputDirectory>
										${project.build.directory}/dependencies/common</outputDirectory>
									<stripVersion>true</stripVersion>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>com.install4j</groupId>
						<artifactId>install4j-maven</artifactId>
						<executions>
							<execution>
								<id>compile-installers</id>
								<phase>package</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<variables>
										<build.phase>${build.phase}</build.phase>
									</variables>
									<release>${product.version}-${build.number}</release>
									<mediaTypes>${build.mediaTypes}</mediaTypes>
									<projectFile>
										${project.basedir}/installer.install4j</projectFile>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<annotationProcessorPaths>
						<path>
							<groupId>info.picocli</groupId>
							<artifactId>picocli-codegen</artifactId>
							<version>4.6.1</version>
						</path>
					</annotationProcessorPaths>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<mainClass>${main.class}</mainClass>
					<arguments>
						<argument>${psftp.args}</argument>
						<argument>${psftp.user}@${psftp.host}</argument>
					</arguments>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>oss-snapshots</id>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		</repository>
	</repositories>
</project>