<?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>com.hello2morrow</groupId>
	<version>26.2.0</version>
    <artifactId>sonargraph-maven-plugin</artifactId>        
    <packaging>maven-plugin</packaging>    
    <name>Sonargraph Maven Plugin</name>
    <url>http://maven.apache.org</url>

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

    <distributionManagement>
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>hello2morrow-maven-repository</id>
            <name>hello2morrow Maven Repository</name>
            <url>sftp://maven.hello2morrow.com/home/hello2morrow/maven/repository</url>
            <layout>default</layout>
        </repository>
        <snapshotRepository>
            <uniqueVersion>true</uniqueVersion>
            <id>hello2morrow-snapshot-repository</id>
            <name>hello2morrow Snapshot Repository</name>
            <url>sftp://maven.hello2morrow.com/home/hello2morrow/maven/snapshots</url>
            <layout>default</layout>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-repository-metadata</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-resolver-provider</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model-builder</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-builder-support</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-settings</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-settings-builder</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.9.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.15.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.platform</groupId>
            <artifactId>org.eclipse.osgi</artifactId>
            <version>3.20.0</version>
            <scope>provided</scope>            
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>3.5.3</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>com.internetitem</groupId>
                <artifactId>write-properties-file-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <id>create-version-properties</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>write-properties-file</goal>
                        </goals>
                        <configuration>
                            <filename>version.properties</filename>
                            <properties>
                                <property>
                                    <name>sonargraph.version</name>
                                    <value>${project.version}.${BUILD_NUMBER}</value>
                                </property>
                            </properties>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                        <locale>US</locale>
                </configuration>
                <executions>
                    <execution>
                        <id>add-source-from-build-client</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/../com.hello2morrow.sonargraph.build.client/src/main</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.15.0</version>
                <executions>
                <execution>
                    <id>default-descriptor</id>
                    <goals>
                        <goal>descriptor</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
                <execution>
                    <id>help-descriptor</id>
                    <goals>
                        <goal>helpmojo</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>skipTests</id>
                <properties>
                    <maven.test.skip>true</maven.test.skip>
                </properties>
        </profile>
        <profile>
            <id>signJars</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-h2m-jarsigner-plugin</artifactId>
                        <version>3.1.0-SNAPSHOT</version>
                        <configuration>
                            <keystore>NONE</keystore>
                            <alias>Hello2morrow, Inc.</alias>
                            <storepass>Th0rped0!</storepass>
                            <providerClass>sun.security.pkcs11.SunPKCS11</providerClass>
                            <storetype>PKCS11</storetype>
                            <providerArg>/var/lib/jenkins/signing/eToken.cfg</providerArg>
                            <tsa>http://timestamp.sectigo.com</tsa> 
                            <executorUrl>http://localhost:8082/exec</executorUrl>
                            <verbose>false</verbose>
                            <threadCount>4</threadCount>
                            <maxTries>2</maxTries>
                         </configuration>
                        <executions>
                            <execution>
                                <id>signJars</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
</project>