<?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>net.maritimeconnectivity.eNav</groupId>
    <artifactId>g1128-schemas</artifactId>
    <version>0.1.3</version>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
    <url>https://maritimeconnectivity.net</url>
    <description>JAXB generated classes for the G1128 specification definitions</description>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <skip.signing>true</skip.signing>
    </properties>

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

    <scm>
        <connection>scm:git:git://github.com/maritimeconnectivity/G1128-Schemas.git</connection>
        <developerConnection>scm:git:ssh://github.com/maritimeconnectivity/G1128-Schemas.git</developerConnection>
        <url>https://github.com/maritimeconnectivity/G1128-Schemas</url>
    </scm>

    <developers>
        <developer>
            <name>Nikolaos Vastardis</name>
            <email>Nikolaos.Vastardis@gla-rad.org</email>
            <organization>General Lighthouse Authorities of the United Kingdom and Ireland</organization>
            <organizationUrl>https://www.gla-rad.org</organizationUrl>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <verbose>true</verbose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <skip>${skip.signing}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <argLine>--illegal-access=permit</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <xjbSources>
                        <xjbSource>src/main/resources/xjb/bindings.xjb</xjbSource>
                    </xjbSources>
                    <sources>
                        <source>src/main/resources/xsd/S100/4.0.0/280611/S100Base.xsd</source>
                        <source>src/main/resources/xsd/S100/4.0.0/280611/S100CI.xsd.xsd</source>
                        <source>src/main/resources/xsd/S100/4.0.0/280611/S100FC.xsd</source>
                        <source>src/main/resources/xsd/S100/4.0.0/280611/S100FD.xsd</source>
                        <source>src/main/resources/xsd/ServiceBaseTypesSchema.xsd</source>
                        <source>src/main/resources/xsd/ServiceDesignSchema.xsd</source>
                        <source>src/main/resources/xsd/ServiceInstanceSchema.xsd</source>
                        <source>src/main/resources/xsd/ServiceSpecificationSchema.xsd</source>
                    </sources>
                    <outputDirectory>${basedir}/src/main/java</outputDirectory>
                    <clearOutputDir>true</clearOutputDir>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.glassfish.jaxb</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.3.2</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.activation</groupId>
                        <artifactId>jakarta.activation</artifactId>
                        <version>1.2.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

    </build>

    <dependencies>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>2.3.2</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.activation</groupId>
            <artifactId>jakarta.activation</artifactId>
            <version>1.2.1</version>
            <scope>runtime</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>sonatype</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</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-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
