<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>br.puc-rio.tecgraf.soma</groupId>
    <artifactId>soma-job-history-schema</artifactId>
    <version>0.6.1-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
        <avro.version>1.8.2</avro.version>        
    </properties>

    <profiles>
        <profile>
            <id>tecgraf</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
			<repositories>
				<repository>
					<id>confluent</id>
					<url>https://packages.confluent.io/maven/</url>
				</repository>
				<repository>
					<id>Tecgraf Releases</id>
					<name>Tecgraf Releases</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases</url>
				</repository>
				<repository>
					<id>Tecgraf 3rd Party</id>
					<name>Tecgraf 3rd Party</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/thirdparty</url>
				</repository>
				<repository>
					<id>Tecgraf Snapshots</id>
					<name>Tecgraf Snapshots</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/snapshots</url>
				</repository>
			</repositories>
		
			<pluginRepositories>
				<pluginRepository>
					<id>Tecgraf Releases</id>
					<name>Tecgraf Releases</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases</url>
				</pluginRepository>
			</pluginRepositories>
		
			<distributionManagement>
				<repository>
					<id>tecgraf-releases</id>
					<name>Releases do Tecgraf</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/releases</url>
				</repository>
				<snapshotRepository>
					<id>tecgraf-snapshots</id>
					<name>Snapshots do Tecgraf</name>
					<url>http://maven.tecgraf.puc-rio.br:8081/nexus/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>
        </profile>
        <profile>
            <id>petrobras</id>
            <repositories>
                <repository>
                    <id>tic-central</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/central/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-thirdparty</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/thirdparty/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-oracle</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/oracle/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>tic-scijava-org</id>
                    <url>http://nexus.petrobras.com.br/nexus/repository/maven-scijava-org/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
                <repository>
                    <id>websintesi-maven-public</id>
                    <url>http://ws-homo.petrobras.com.br:8082/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
            <distributionManagement>
                <repository>
                    <id>websintesi-releases</id>
                    <name>Releases do Websintesi</name>
                    <url>
                        http://ws-homo.petrobras.com.br:8082/repository/websintesi-releases/
                    </url>
                </repository>
                <snapshotRepository>
                    <id>websintesi-snapshots</id>
                    <name>Snapshots do Websintesi</name>
                    <url>
                        http://ws-homo.petrobras.com.br:8082/repository/websintesi-snapshots/
                    </url>
                </snapshotRepository>
            </distributionManagement>
        </profile> 
    </profiles>

    <scm>
        <url>https://git.tecgraf.puc-rio.br/soma/soma-job-history-schema
        </url>
        <connection>
            scm:git:ssh://git@git.tecgraf.puc-rio.br/soma/soma-job-history-schema.git
        </connection>
        <developerConnection>
            scm:git:ssh://git@git.tecgraf.puc-rio.br/soma/soma-job-history-schema.git
        </developerConnection>
        <tag>HEAD</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
            <version>${avro.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-maven-plugin</artifactId>
                <version>${avro.version}</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>schema</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${project.basedir}/src/main/avro</sourceDirectory>
                            <stringType>String</stringType>
                            <!--<outputDirectory>${project.basedir}/src/main/java</outputDirectory>-->
                            <includes>
                                <include>**/*.avsc</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5</version>
                <configuration>
                    <compilerArgument>-Xlint:deprecation</compilerArgument>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </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.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/target/generated-sources/avro</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>            
        </plugins>
    </build>
</project>
