<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <name>omtd-model</name>
    <url>http://maven.apache.org</url>
    <groupId>eu.openminted</groupId>
    <artifactId>omtd-model</artifactId>
    <version>3.0.2</version>
    <packaging>jar</packaging>

    <description>The model classes for OpenMinTeD</description>


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

    <scm>
        <url>https://github.com/openminted/omtd-model</url>
        <connection>scm:git:git://github.com/openminte/omtd-model.git</connection>
        <developerConnection>scm:git:git@github.com:openminted/omtd-registry-api.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>courado</id>
            <name>Steve Gatsios</name>
            <email>stevengatsios@gmail.com</email>
            <url>https://github.com/courado</url>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jaxb2_commons.version>0.11.1</jaxb2_commons.version>
        <rename.exec.skip>true</rename.exec.skip>
        <description.exec.skip>true</description.exec.skip>
        <typescript.exec.skip>true</typescript.exec.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-runtime</artifactId>
            <version>${jaxb2_commons.version}</version>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <!--<pluginManagement>-->
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <maxmemory>512m</maxmemory>
                    <links>
                        <link>http://docs.oracle.com/javase/7/docs/api/</link>
                    </links>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>xsd-renaming</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <skip>${rename.exec.skip}</skip>
                            <executable>python</executable>
                            <workingDirectory>src/main/resources/parsed</workingDirectory>
                            <arguments>
                                <argument>enum.py</argument>
                                <argument>-d../xsd/Schema/</argument>
                                <argument>-peu.openminted.registry.domain</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>description-generation</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <skip>${description.exec.skip}</skip>
                            <executable>python</executable>
                            <workingDirectory>src/main/resources/parsed</workingDirectory>
                            <arguments>
                                <argument>extract_doc.py</argument>
                                <argument>.</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.13.3</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <verbose>false</verbose>
                            <!--<generateDirectory>${project.build.sourceDirectory}</generateDirectory>-->
                            <schemaDirectory>src/main/resources/parsed</schemaDirectory>
                            <bindingDirectory>src/main/resources/xjb</bindingDirectory>
                            <removeOldOutput>false</removeOldOutput>
                            <episode>false</episode>
                            <generatePackage>eu.openminted.registry.domain</generatePackage>
                            <extension>true</extension>
                            <args>
                                <arg>-XfixJAXB1058</arg>
                                <arg>-no-header</arg>
                                <arg>-XautoNameResolution</arg>
                                <arg>-Xsimplify</arg>
                                <arg>-Xsetters</arg>
                                <arg>-Xxew</arg>
                                <arg>-Xxew:instantiate lazy</arg>
                                <!--<arg>-Xxew:plural</arg>-->
                                <arg>-Xfixed-value</arg>
                            </args>
                            <plugins>
                                <plugin>
                                    <groupId>com.github.jaxb-xew-plugin</groupId>
                                    <artifactId>jaxb-xew-plugin</artifactId>
                                    <version>1.9</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.jvnet.jaxb2_commons</groupId>
                                    <artifactId>jaxb2-basics</artifactId>
                                    <version>${jaxb2_commons.version}</version>
                                </plugin>
                                <plugin>
                                    <groupId>com.github.fbdo</groupId>
                                    <artifactId>jaxb2-fixed-value</artifactId>
                                    <version>1.2</version>
                                </plugin>
                            </plugins>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <!-- This dependency is required quantity execute the plugin -->
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-basics-tools</artifactId>
                        <version>0.9.4</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>cz.habarta.typescript-generator</groupId>
                <artifactId>typescript-generator-maven-plugin</artifactId>
                <version>1.29.366</version>
                <executions>
                    <execution>
                        <id>generate1</id>
                        <!--<phase>process-classes</phase>-->
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <jsonLibrary>jackson2</jsonLibrary>
                            <outputFileType>implementationFile</outputFileType>
                            <mapEnum>asNumberBasedEnum</mapEnum>
                            <mapClasses>asClasses</mapClasses>
                            <customTypeMappings>
                                <customTypeMapping>javax.xml.datatype.XMLGregorianCalendar:Date</customTypeMapping>
                            </customTypeMappings>
                            <customTypeNaming>
                                eu.openminted.registry.domain.Date:OMTDDate
                            </customTypeNaming>
                            <classPatterns>
                                <pattern>eu.openminted.registry.domain.*</pattern>
                            </classPatterns>
                            <outputFile>target/openminted-model.ts</outputFile>
                            <outputKind>module</outputKind>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>
                    <flowInitContext>
                        <developBranchName>develop</developBranchName>
                        <versionTagPrefix>v</versionTagPrefix>
                    </flowInitContext>
                    <username>USERNAME_FOR_A_GIT_USER</username>
                    <password>PASSWORD_FOR_A_GIT_USER</password>
                    <noDeploy>true</noDeploy>
                    <squash>true</squash>
                </configuration>
            </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>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
