refactoring skel

This commit is contained in:
Guillaume Polaert 2017-05-31 15:25:02 +02:00
parent 83a30ad181
commit 1a41751e34
16 changed files with 298 additions and 282 deletions

View File

@ -0,0 +1,199 @@
<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>
<parent>
<groupId>com.datadoghq</groupId>
<artifactId>dd-trace-java</artifactId>
<version>0.0.2-SNAPSHOT</version>
</parent>
<artifactId>dd-java-agent-ittests</artifactId>
<packaging>jar</packaging>
<name>dd-java-agent-ittests</name>
<description>Datadog Java Agent integration tests</description>
<url>https://github.com/datadog/dd-trace-java</url>
<properties>
<dd-trace.version>0.0.2-SNAPSHOT</dd-trace.version>
</properties>
<dependencies>
<!-- DD Agent tests (@Trace annotation)-->
<dependency>
<groupId>com.datadoghq</groupId>
<artifactId>dd-java-agent</artifactId>
<version>${dd-trace.version}</version>
<scope>test</scope>
</dependency>
<!-- JUnit tests -->
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-mock</artifactId>
<version>${opentracing.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.7.22</version>
<scope>test</scope>
</dependency>
<!-- Mongo tests -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.4.2</version>
<scope>test</scope>
</dependency>
<!-- Jetty Servlet tests -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.1.v20170120</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.4.1.v20170120</version>
<scope>test</scope>
</dependency>
<!-- Tomcat Servlet tests -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.0.41</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>8.0.41</version>
<scope>test</scope>
</dependency>
<!-- AWS SDK tests -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.132</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- OkHTTP tests -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<!-- Apache HTTP client tests -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<!-- TODO fixit, Due to a Java Heap error, skiping test-->
<skipTests>true</skipTests>
<includes>
<include>*Test.java</include>
</includes>
<forkCount>3</forkCount>
<reuseForks>false</reuseForks>
<argLine>-Xmx1g -Xms1g -XX:MaxPermSize=512m -Dorg.jboss.byteman.verbose=true
-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${project.version}/dd-java-agent-${project.version}.jar
</argLine>
<workingDirectory>target/FORK_DIRECTORY_${surefire.forkNumber}</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<!-- <exclude>ch.qos.logback:*</exclude> -->
<!-- <exclude>org.slf4j:*</exclude> -->
</excludes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>otarules.btm</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Agent-Class>io.opentracing.contrib.agent.AnnotationsTracingAgent</Agent-Class>
<Premain-Class>io.opentracing.contrib.agent.AnnotationsTracingAgent
</Premain-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
<Boot-Class-Path>./${project.artifactId}.jar</Boot-Class-Path>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
<root level="INFO">
<appender-ref ref="console"/>
</root>
</configuration>

View File

@ -15,25 +15,30 @@
<properties>
<!-- Datadog versions -->
<dd-trace.version>0.0.2-SNAPSHOT</dd-trace.version>
<!-- Opentracing versions -->
<opentracing.version>0.22.0</opentracing.version>
<ot.agent.version>0.0.12</ot.agent.version>
<ot.contrib.webservlet.version>0.0.8</ot.contrib.webservlet.version>
<ot.contrib.mongo.version>0.0.1</ot.contrib.mongo.version>
<ot.contrib.okhttp.version>0.0.4</ot.contrib.okhttp.version>
<opentracing.version>0.22.0</opentracing.version>
<java.version>1.8</java.version>
<ot.dd-trace.version>0.0.2-SNAPSHOT</ot.dd-trace.version>
<ot.contrib.jdbc.version>0.0.1</ot.contrib.jdbc.version>
<ot.contrib.aws.version>0.0.1</ot.contrib.aws.version>
<ot.contrib.httpclient.version>0.0.1</ot.contrib.httpclient.version>
<!-- Others versions -->
<java.version>1.7</java.version>
</properties>
<dependencies>
<!-- DD tracer CORE -->
<!-- DD tracer deps-->
<dependency>
<groupId>com.datadoghq</groupId>
<artifactId>dd-trace</artifactId>
<version>${ot.dd-trace.version}</version>
<version>${dd-trace.version}</version>
</dependency>
<!-- opentracing agent -->
<!-- Opentracing agent -->
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-agent</artifactId>
@ -63,6 +68,8 @@
<artifactId>opentracing-web-servlet-filter</artifactId>
<version>${ot.contrib.webservlet.version}</version>
</dependency>
<!-- Mongo instrumentation -->
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-mongo-driver</artifactId>
@ -78,11 +85,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- Opentracing JDBC contribution -->
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-jdbc</artifactId>
<version>0.0.1</version>
<version>${ot.contrib.jdbc.version}</version>
</dependency>
<!-- Client side instrumentation -->
@ -102,7 +110,7 @@
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-aws-sdk</artifactId>
<version>0.0.1</version>
<version>${ot.contrib.aws.version}</version>
<exclusions>
<exclusion>
<groupId>com.amazonaws</groupId>
@ -115,7 +123,7 @@
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-apache-httpclient</artifactId>
<version>0.0.1</version>
<version>${ot.contrib.httpclient.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
@ -124,123 +132,11 @@
</exclusions>
</dependency>
<!-- ES instrumentation -->
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-elasticsearch-client</artifactId>
<version>0.0.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- JUnit tests -->
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-mock</artifactId>
<version>${opentracing.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.7.22</version>
<scope>test</scope>
</dependency>
<!-- Mongo tests -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.4.2</version>
<scope>test</scope>
</dependency>
<!-- Jetty Servlet tests -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.1.v20170120</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.4.1.v20170120</version>
<scope>test</scope>
</dependency>
<!-- Tomcat Servlet tests -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.0.41</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>8.0.41</version>
<scope>test</scope>
</dependency>
<!-- AWS SDK tests -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.132</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- OkHTTP tests -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<!-- Apache HTTP client tests -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- Override the default settings -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -250,36 +146,6 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<skipTests>true</skipTests>
<includes>
<include>*Test.java</include>
</includes>
<forkCount>3</forkCount>
<reuseForks>false</reuseForks>
<argLine>-Xmx1g -Xms1g -XX:MaxPermSize=512m -Dorg.jboss.byteman.verbose=true
-javaagent:${M2_REPO}/com/datadoghq/dd-java-agent/${project.version}/dd-java-agent-${project.version}.jar
</argLine>
<workingDirectory>target/FORK_DIRECTORY_${surefire.forkNumber}</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
@ -291,12 +157,6 @@
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<!-- <exclude>ch.qos.logback:*</exclude> -->
<!-- <exclude>org.slf4j:*</exclude> -->
</excludes>
</artifactSet>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>otarules.btm</resource>

View File

@ -10,51 +10,18 @@
<artifactId>async-tracing</artifactId>
<name>async-tracing</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- DD tracer CORE -->
<dependency>
<groupId>com.datadoghq</groupId>
<artifactId>dd-trace</artifactId>
<version>${ot.dd-trace.version}</version>
<version>${dd-trace.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.opentracing.contrib/opentracing-spanmanager -->
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spanmanager</artifactId>
<version>0.0.5</version>
<version>${opentracing.spanmanager.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -18,7 +18,7 @@
<dependency>
<groupId>com.datadoghq</groupId>
<artifactId>dd-java-agent</artifactId>
<version>${ot.dd-trace.version}</version>
<version>${dd-trace.version}</version>
</dependency>
<!-- Application dependencies -->
@ -39,30 +39,4 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,5 +1,6 @@
<?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">
<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>
<artifactId>dd-trace-java</artifactId>
<groupId>com.datadoghq</groupId>
@ -16,32 +17,31 @@
<module>spring-boot-jdbc</module>
</modules>
<properties>
<!-- Datadog version -->
<dd-trace.version>0.0.2-SNAPSHOT</dd-trace.version>
<!-- Opentracing versions -->
<opentracing.spanmanager.version>0.0.5</opentracing.spanmanager.version>
<!-- Others versions -->
<java.version>1.8</java.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>${java.version}</source>
<target>${java.version}</target>
<fork>true</fork>
<maxmem>512m</maxmem>
<useIncrementalCompilation>false
</useIncrementalCompilation><!-- http://bcn.adityakishore.com/2014/11/broken-incremental-compilation-with.html -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -58,38 +58,17 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-resources-plugin</artifactId>-->
<!--<version>2.7</version>-->
<!--<configuration>-->
<!--<delimiters>-->
<!--<delimiter>@</delimiter>-->
<!--</delimiters>-->
<!--<useDefaultDelimiters>false</useDefaultDelimiters>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

49
pom.xml
View File

@ -6,17 +6,12 @@
<artifactId>dd-trace-java</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<!-- Project information -->
<name>dd-trace-java</name>
<description>Datadog tracing in Java</description>
<url>https://github.com/datadog/dd-trace-java</url>
<properties>
<opentracing.version>0.22.0</opentracing.version>
<java.version>1.7</java.version>
<ot.dd-trace.version>0.0.1-SNAPSHOT</ot.dd-trace.version>
</properties>
<licenses>
<license>
<name>The MIT License (MIT)</name>
@ -25,13 +20,6 @@
</license>
</licenses>
<scm>
<url>https://github.com/datadog/dd-trace-java</url>
<connection>scm:git:git://github.com/datadog/dd-trace-java.git</connection>
<developerConnection>scm:git:git@github.com:datadog/dd-trace-java.git</developerConnection>
<tag>v0.0.1</tag>
</scm>
<developers>
<developer>
<id>datadog</id>
@ -40,12 +28,23 @@
</developer>
</developers>
<scm>
<url>https://github.com/datadog/dd-trace-java</url>
<connection>scm:git:git://github.com/datadog/dd-trace-java.git</connection>
<developerConnection>scm:git:git@github.com:datadog/dd-trace-java.git</developerConnection>
</scm>
<modules>
<module>dd-trace</module>
<module>dd-java-agent</module>
<module>dd-java-agent-ittests</module>
<module>dd-trace-examples</module>
</modules>
<properties>
<opentracing.version>0.22.0</opentracing.version>
<java.version>1.7</java.version>
</properties>
<distributionManagement>
<snapshotRepository>
@ -60,6 +59,7 @@
<build>
<plugins>
<!-- Attach sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -73,6 +73,23 @@
</execution>
</executions>
</plugin>
<!-- Attach Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Sign jar and resources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
@ -87,6 +104,8 @@
</execution>
</executions>
</plugin>
<!-- Default Java Compatibility for the projects -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -96,6 +115,8 @@
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Stuff for releasing on the Maven Central -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>