<?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.github.kyriosdata.cid10</groupId>
    <artifactId>cid10-dados</artifactId>
    <version>2008.1.1</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>

    <description>
        Oferece código e dados para acesso eficiente (inclusive busca),
        ao conteúdo da CID-10 (inclusive Oncologia), versão 2008,
        disponibilizada pelo DATASUS.
    </description>

    <url>https://github.com/kyriosdata/cid10</url>

    <inceptionYear>2017</inceptionYear>

    <licenses>
        <license>
            <name>Creative Commons Attribution 4.0 International (CC BY 4.0)</name>
            <comments>
                Copyright (c) 2017, 2018. Fábio Nogueira de Lucena
                Fábrica de Software - Instituto de Informática (UFG)
            </comments>
            <url>https://creativecommons.org/licenses/by/4.0/</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>kyriosdata</id>
            <name>Fábio Nogueira de Lucena</name>
            <email>fabio@inf.ufg.br</email>
            <organization>Instituto de Informática (UFG)</organization>
            <organizationUrl>http://www.inf.ufg.br</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/kyriosdata/cid10.git</connection>
        <developerConnection>scm:git:https://github.com/kyriosdata/cid10.git</developerConnection>
        <url>https://github.com/kyriosdata/cid10</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.2</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <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>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <!-- conteúdo do jar file a ser gerado -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <addClasspath>false</addClasspath>
                            <mainClass>com.github.kyriosdata.cid10.busca.Aplicacao</mainClass>
                        </manifest>
                    </archive>
                    <excludes>
                        <exclude>datasus/**</exclude>
                        <exclude>META-INF/**</exclude>
                        <exclude>**/preprocessor/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>build-test-environment-original</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>com.github.kyriosdata.cid10.preprocessor.GeraOriginalAjustado</mainClass>
                                    <classpathScope>test</classpathScope>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.0.2</version>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <!-- here the phase you need -->
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${basedir}/target/cid</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources/cid</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Gerar documentação (javadoc) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <show>public</show>
                            <additionalOptions>
                                <additionalOption>-html5</additionalOption>
                            </additionalOptions>
                        </configuration>
                        <executions>
                            <execution>
                                <id>package-javadoc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Agrega sources em jar -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>package-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Acesso para deploy no OSSRH Nexus Repository Manager -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                    <!-- Assinar arquivos -->
                    <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>