<?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">

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.github.kristofa</groupId>
  <artifactId>brave</artifactId>
  <version>3.0.0</version>
  <packaging>pom</packaging>

  <name>brave</name>
  <description>
  Java implementation of Dapper (http://research.google.com/pubs/pub36356.html) compatible with Zipkin (https://github.com/twitter/zipkin/).
  </description>
  <url>https://github.com/kristofa/brave</url>
  <licenses>
  	<license>
		<name>Apache 2</name>
		<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		<distribution>repo</distribution>
	</license>
   </licenses>
   <scm>
   		<connection>scm:git:git@github.com:kristofa/brave.git</connection>
    	<url>git@github.com:kristofa/brave.git</url>
    	<developerConnection>scm:git:git@github.com:kristofa/brave.git</developerConnection>
   </scm>
   <developers>
   		<developer>
      		<id>kristofa</id>
      		<name>Kristof Adriaenssens</name>
      		<email>kr_adr@yahoo.co.uk</email>
    	</developer>
   </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>4.1.6.RELEASE</spring.version>
    <log4j.version>2.3</log4j.version>
    <httpcomponents.version>4.4.1</httpcomponents.version>
  </properties>

  <modules>
    <module>brave-core</module>
    <module>brave-http</module>
    <module>brave-core-spring</module>
    <module>brave-resteasy-spring</module>
    <module>brave-resteasy3-spring</module>
    <module>brave-zipkin-spancollector</module>
    <module>brave-tracefilters</module>
    <module>brave-jersey</module>
    <module>brave-jersey2</module>
    <module>brave-jaxrs2</module>
    <module>brave-apache-http-interceptors</module>
    <module>brave-spring-web-servlet-interceptor</module>
    <module>brave-spring-resttemplate-interceptors</module>
    <module>brave-mysql</module>
    <module>brave-web-servlet-filter</module>
  </modules>

  <dependencyManagement>
  	<dependencies>
        <dependency>
            <groupId>org.apache.thrift</groupId>
            <artifactId>libthrift</artifactId>
            <version>0.9.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
  		<dependency>
            <groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
        </dependency>
        <dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.auto.value</groupId>
            <artifactId>auto-value</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>${httpcomponents.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpcomponents.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jul</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
        </dependency>
  	</dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
    <!-- Main code uses jul and tests log with log4j -->
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jul</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
		<groupId>org.mockito</groupId>
		<artifactId>mockito-all</artifactId>
		<version>1.10.19</version>
		<scope>test</scope>
	</dependency>
  </dependencies>

  <build>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

        <pluginManagement>
      	  <plugins>
       	     	<plugin>
                	<inherited>true</inherited>
                	<artifactId>maven-compiler-plugin</artifactId>
                	<version>3.1</version>
                	<configuration>
                   		<source>1.8</source>
                    	<target>1.8</target>
                    	<optimize>true</optimize>
                    	<debug>true</debug>
                	</configuration>
                    <executions>
                        <!-- Ensure main source tree compiles to Java 7 bytecode. -->
                        <execution>
                            <id>default-compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <source>1.7</source>
                                <target>1.7</target>
                            </configuration>
                        </execution>
                    </executions>
       	     	</plugin>
                <!-- Make sure Java 8 classes and methods aren't accidentally used -->
                <plugin>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
                    <version>1.14</version>
                    <configuration>
                        <signature>
                            <groupId>org.codehaus.mojo.signature</groupId>
                            <artifactId>java17</artifactId>
                            <version>1.0</version>
                        </signature>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            	<plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                	<artifactId>maven-eclipse-plugin</artifactId>
                	<version>2.9</version>
                	<configuration>
                    	<downloadSources>true</downloadSources>
                    	<downloadJavadocs>true</downloadJavadocs>
                	</configuration>
            	</plugin>
            	<plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                	<artifactId>maven-source-plugin</artifactId>
                	<version>2.2</version>
                	<executions>
                    	<execution>
                        	<id>attach-sources</id>
                        	<goals>
                            	<goal>jar</goal>
                        	</goals>
                    	</execution>
                	</executions>
            	</plugin>
            	<plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                	<artifactId>maven-javadoc-plugin</artifactId>
                	<version>2.8.1</version>
                	<executions>
                    	<execution>
                        	<id>attach-javadocs</id>
                        	<goals>
                            	<goal>jar</goal>
                        	</goals>
                    	</execution>
                	</executions>
                    <configuration>
                        <additionalJOption>-Xdoclint:none</additionalJOption>
                    </configuration>
            	</plugin>
            	<plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                	<artifactId>maven-deploy-plugin</artifactId>
                	<version>2.7</version>
            	</plugin>
            	<plugin>
            		<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.14</version>
					<executions>
						<execution>
							<id>integration-test</id>
							<goals>
								<goal>integration-test</goal>
							</goals>
						</execution>
						<execution>
							<id>verify</id>
							<goals>
								<goal>verify</goal>
							</goals>
						</execution>
					</executions>
	    		</plugin>
          </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
