agent
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>com.nerdvision</groupId> <artifactId>agent</artifactId> <version>3.0.2</version> </dependency>
<?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> <parent> <groupId>com.nerdvision</groupId> <artifactId>java-agent</artifactId> <version>3.0.2</version> <relativePath>../pom.xml</relativePath> </parent> <properties> <relocation.package>com.nerdvision.relocated</relocation.package> <relocation.native.prefix>com_nerdvision_relocated</relocation.native.prefix> <grpc.version>1.20.0</grpc.version> <tcnative.version>2.0.51.Final</tcnative.version> <allowed.coverage>0.88</allowed.coverage> <allowed.branches>0.75</allowed.branches> <!--One class/method is allowed for main class/method--> <allowed.methods>19</allowed.methods> <allowed.classes>0</allowed.classes> </properties> <artifactId>agent</artifactId> <dependencyManagement> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>reflection-api</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>reflection-java9</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.7.30</version> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.12.11</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty</artifactId> <version>${grpc.version}</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>linux-x86_64</classifier> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>windows-x86_64</classifier> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>osx-x86_64</classifier> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-protobuf</artifactId> <version>${grpc.version}</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-stub</artifactId> <version>${grpc.version}</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-core</artifactId> <version>${grpc.version}</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-context</artifactId> <version>${grpc.version}</version> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>grpc-api</artifactId> <version>2.0.0</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20190722</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-text</artifactId> <version>1.3</version> <!--latest version that is java 1.7--> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- These are the plugin deps that are added into the jar--> <dependency> <groupId>com.nerdvision</groupId> <artifactId>data-dog</artifactId> <version>${project.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>agent-api</artifactId> <version>${project.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-text</artifactId> <scope>compile</scope> </dependency> <!-- we use slf4j api but JUL impl for logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>linux-x86_64</classifier> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>windows-x86_64</classifier> <scope>compile</scope> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>osx-x86_64</classifier> <scope>compile</scope> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-protobuf</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-stub</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-core</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-context</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>grpc-api</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm-commons</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.ow2.asm</groupId> <artifactId>asm-tree</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>reflection-java9</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>reflection-api</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-grpc</artifactId> <version>3.6.3</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mock-server</groupId> <artifactId>mockserver-netty</artifactId> <version>RELEASE</version> <scope>test</scope> </dependency> <dependency> <groupId>com.nerdvision</groupId> <artifactId>test-utils</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-jasper</artifactId> <version>9.0.6</version> <!--this version needs to match the version of tomcat--> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <!-- Unpack tcnative so we can relocate these --> <id>unpack-tcnative</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <!-- we need to shade the java code for netty, this then requires us to shade the native libs with the same prefix--> <artifactItem> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>linux-x86_64</classifier> <includes>META-INF/native/*tcnative*</includes> <type>jar</type> <outputDirectory>${project.build.directory}/unpack/</outputDirectory> </artifactItem> <artifactItem> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>windows-x86_64</classifier> <includes>META-INF/native/*tcnative*</includes> <type>jar</type> <outputDirectory>${project.build.directory}/unpack/</outputDirectory> </artifactItem> <artifactItem> <groupId>io.netty</groupId> <artifactId>netty-tcnative-boringssl-static</artifactId> <version>${tcnative.version}</version> <classifier>osx-x86_64</classifier> <includes>META-INF/native/*tcnative*</includes> <type>jar</type> <outputDirectory>${project.build.directory}/unpack/</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>${maven-shade-plugin.version}</version> <configuration> <createDependencyReducedPom>false</createDependencyReducedPom> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Premain-Class>com.nerdvision.agent.Agent</Premain-Class> <Agent-Class>com.nerdvision.agent.Agent</Agent-Class> <X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK> <Can-Retransform-Classes>true</Can-Retransform-Classes> <!-- Git specific --> <Git-Branch>${git.branch}</Git-Branch> <Git-Commit-Id>${git.commit.id}</Git-Commit-Id> <Git-Commit-Time>${git.commit.time}</Git-Commit-Time> <Git-Dirty>${git.dirty}</Git-Dirty> <Git-Tags>${git.tags}</Git-Tags> <Git-Remote-Origin-Url>${git.remote.origin.url}</Git-Remote-Origin-Url> <!-- Add build time --> <Build-Time>${maven.build.timestamp}</Build-Time> <!-- Version components --> <Version-Major>${parsedVersion.majorVersion}</Version-Major> <Version-Minor>${parsedVersion.minorVersion}</Version-Minor> <Version-Micro>${parsedVersion.incrementalVersion}</Version-Micro> <Version>${project.version}</Version> <!-- Add info --> <Implementation-Build>${git.commit.id}</Implementation-Build> <Implementation-Branch>${git.branch}</Implementation-Branch> <!-- Add Build Info --> <X-CI-Project-Name>${env.CI_PROJECT_NAME}</X-CI-Project-Name> <X-CI-Pipeline-Id>${env.CI_PIPELINE_ID}</X-CI-Pipeline-Id> <X-CI-Pipeline-Iid>${env.CI_PIPELINE_IID}</X-CI-Pipeline-Iid> <X-CI-Pipeline-Source>${env.CI_PIPELINE_SOURCE}</X-CI-Pipeline-Source> <X-CI-Pipeline-Url>${env.CI_PIPELINE_URL}</X-CI-Pipeline-Url> <Specification-Title>${project.artifactId}</Specification-Title> <Specification-Version>${project.version}</Specification-Version> <Implementation-Title>${project.name}</Implementation-Title> <Implementation-Version>${project.version}</Implementation-Version> <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> </manifestEntries> </transformer> <!--These shade the tcnative libs with the relocation.native.prefix--> <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> <resource>META-INF/native/lib${relocation.native.prefix}_netty_tcnative_linux_x86_64.so</resource> <file>${project.build.directory}/unpack/META-INF/native/libnetty_tcnative_linux_x86_64.so</file> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> <resource>META-INF/native/lib${relocation.native.prefix}_netty_tcnative_osx_x86_64.jnilib</resource> <file>${project.build.directory}/unpack/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib</file> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> <resource>META-INF/native/${relocation.native.prefix}_netty_tcnative_windows_x86_64.dll</resource> <file>${project.build.directory}/unpack/META-INF/native/netty_tcnative_windows_x86_64.dll</file> </transformer> </transformers> <filters> <!-- Excluded all signatures from other jars --> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> <exclude>META-INF/native-image/**/*.*</exclude> <exclude>META-INF/proguard/**/*.*</exclude> <exclude>META-INF/services/**/*.*</exclude> <exclude>META-INF/native/**/*.*</exclude> <exclude>META-INF/dgminfo</exclude> <exclude>META-INF/*.properties</exclude> <exclude>**/LICENSE.txt</exclude> <exclude>**/*.xsd</exclude> <exclude>**/*-style.xml</exclude> <exclude>**/license.header</exclude> <exclude>**/library.properties</exclude> <exclude>**/LICENSE</exclude> <exclude>**/NOTICE</exclude> <exclude>module-info.class</exclude> <exclude>**/*.proto</exclude> <exclude>android/**/*.*</exclude> <exclude>javax/**/*.*</exclude> <exclude>org/codehaus/mojo/**/*.*</exclude> <!-- <exclude>org/codehaus/groovy/**/*.*</exclude>--> <exclude>org/checkerframework/**/*.*</exclude> <exclude>io/opencensus/**/*.*</exclude> <exclude>com/google/gson/**/*.*</exclude> <exclude>com/google/api/**/*.*</exclude> <exclude>com/google/cloud/**/*.*</exclude> <exclude>com/google/errorprone/**/*.*</exclude> <exclude>com/google/j2objc/**/*.*</exclude> <exclude>com/google/logging/**/*.*</exclude> <exclude>com/google/longrunning/**/*.*</exclude> <exclude>com/google/rpc/**/*.*</exclude> <exclude>com/google/type/**/*.*</exclude> <exclude>com/google/thirdparty/**/*.*</exclude> <exclude>com/google/common/xml/**/*.*</exclude> <exclude>com/google/common/html/**/*.*</exclude> <!-- <exclude>com/google/common/eventbus/**/*.*</exclude>--> <!-- <exclude>com/google/common/math/**/*.*</exclude>--> <exclude>com/google/common/reflect/**/*.*</exclude> <exclude>com/google/common/graph/**/*.*</exclude> <!-- <exclude>com/google/common/cache/**/*.*</exclude>--> <!-- <exclude>com/google/common/util/**/*.*</exclude>--> <!-- <exclude>com/google/common/collect/**/*.*</exclude>--> <exclude>groovy/grape/**/*.*</exclude> <!-- <exclude>antlr/**/*.*</exclude>--> <exclude>*.html</exclude> </excludes> </filter> <filter> <artifact>org.codehaus.groovy:groovy:*</artifact> </filter> </filters> <relocations> <relocation> <pattern>org.json</pattern> <shadedPattern>${relocation.package}.org.json</shadedPattern> </relocation> <relocation> <pattern>okio</pattern> <shadedPattern>${relocation.package}.okio</shadedPattern> </relocation> <relocation> <pattern>okhttp3</pattern> <shadedPattern>${relocation.package}.okhttp3</shadedPattern> </relocation> <relocation> <pattern>io.grpc</pattern> <shadedPattern>${relocation.package}.io.grpc</shadedPattern> </relocation> <relocation> <pattern>io.netty</pattern> <shadedPattern>${relocation.package}.io.netty</shadedPattern> </relocation> <relocation> <pattern>org.objectweb.asm</pattern> <shadedPattern>${relocation.package}.org.objectweb.asm</shadedPattern> </relocation> <relocation> <pattern>com.google</pattern> <shadedPattern>${relocation.package}.com.google</shadedPattern> </relocation> <relocation> <pattern>org.slf4j</pattern> <shadedPattern>${relocation.package}.org.slf4j</shadedPattern> </relocation> <relocation> <pattern>org.apache</pattern> <shadedPattern>${relocation.package}.org.apache</shadedPattern> </relocation> </relocations> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>3.1.0</version> <configuration> <descriptors> <descriptor>assembly.xml</descriptor> </descriptors> <archive> <manifest> <addClasspath>false</addClasspath> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> <manifestEntries> <Premain-Class>com.nerdvision.agent.Agent</Premain-Class> <Agent-Class>com.nerdvision.agent.Agent</Agent-Class> <X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK> <Can-Retransform-Classes>true</Can-Retransform-Classes> <!-- Git specific --> <Git-Branch>${git.branch}</Git-Branch> <Git-Commit-Id>${git.commit.id}</Git-Commit-Id> <Git-Commit-Time>${git.commit.time}</Git-Commit-Time> <Git-Dirty>${git.dirty}</Git-Dirty> <Git-Tags>${git.tags}</Git-Tags> <Git-Remote-Origin-Url>${git.remote.origin.url}</Git-Remote-Origin-Url> <!-- Add build time --> <Build-Time>${maven.build.timestamp}</Build-Time> <!-- Version components --> <Version-Major>${parsedVersion.majorVersion}</Version-Major> <Version-Minor>${parsedVersion.minorVersion}</Version-Minor> <Version-Micro>${parsedVersion.incrementalVersion}</Version-Micro> <Version>${project.version}</Version> <!-- Add info --> <Implementation-Build>${git.commit.id}</Implementation-Build> <Implementation-Branch>${git.branch}</Implementation-Branch> <!-- Add Build Info --> <X-CI-Project-Name>${env.CI_PROJECT_NAME}</X-CI-Project-Name> <X-CI-Pipeline-Id>${env.CI_PIPELINE_ID}</X-CI-Pipeline-Id> <X-CI-Pipeline-Iid>${env.CI_PIPELINE_IID}</X-CI-Pipeline-Iid> <X-CI-Pipeline-Source>${env.CI_PIPELINE_SOURCE}</X-CI-Pipeline-Source> <X-CI-Pipeline-Url>${env.CI_PIPELINE_URL}</X-CI-Pipeline-Url> <Specification-Title>${project.artifactId}</Specification-Title> <Specification-Version>${project.version}</Specification-Version> <Implementation-Title>${project.name}</Implementation-Title> <Implementation-Version>${project.version}</Implementation-Version> <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id> </manifestEntries> </archive> <finalName>nerdvision-${project.version}</finalName> <appendAssemblyId>false</appendAssemblyId> </configuration> <executions> <execution> <id>assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <executions> <execution> <id>default-test</id> <goals> <goal>test</goal> </goals> <configuration> <trimStackTrace>false</trimStackTrace> <systemProperties> <property> <name>nv.callback.class</name> <value>com.nerdvision.agent.snapshot.Callback</value> </property> <property> <name>nv.hook.class</name> <value>com.nerdvision.agent.plugins.MethodHook</value> </property> <property> <name>nv.logging.level</name> <value>INFO</value> </property> </systemProperties> </configuration> </execution> </executions> </plugin> <!-- Ensure the jars and our code is the correct java version --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4.1</version> <executions> <execution> <id>enforce-versions</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <enforceBytecodeVersion> <maxJdkVersion>${maven.compiler.target}</maxJdkVersion> <ignoredScopes> <ignoreScope>test</ignoreScope> </ignoredScopes> <excludes> <exclude>com.nerdvision:reflection-java9</exclude> </excludes> </enforceBytecodeVersion> </rules> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>extra-enforcer-rules</artifactId> <version>1.2</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.5</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> </execution> <execution> <id>default-report</id> <phase>prepare-package</phase> <goals> <goal>report</goal> </goals> <configuration> <excludes> <!-- We exclude this package as it is dealing with our byte code and we do not want/need coverage--> <exclude>**/com/nerdvision/agent/inst/asm/**</exclude> <exclude>**/com/nerdvision/agent/AgentImpl*</exclude> <exclude>**/com/nerdvision/agent/Agent*</exclude> <exclude>**/java/com/nerdvision/agent/snapshot/ProxyCallback*</exclude> <exclude>**/java/com/nerdvision/agent/snapshot/ProxyMethodHook*</exclude> </excludes> </configuration> </execution> <execution> <id>default-check</id> <goals> <goal>check</goal> </goals> <configuration> <excludes> <!-- We exclude this package as it is dealing with our byte code and we do not want/need coverage--> <exclude>**/com/nerdvision/agent/inst/asm/**</exclude> <exclude>**/com/nerdvision/agent/AgentImpl*</exclude> <exclude>**/com/nerdvision/agent/Agent*</exclude> <exclude>**/java/com/nerdvision/agent/snapshot/ProxyCallback*</exclude> <exclude>**/java/com/nerdvision/agent/snapshot/ProxyMethodHook*</exclude> </excludes> <haltOnFailure>${allowed.fail}</haltOnFailure> <rules> <rule implementation="org.jacoco.maven.RuleConfiguration"> <element>BUNDLE</element> <limits> <limit implementation="org.jacoco.report.check.Limit"> <counter>INSTRUCTION</counter> <value>COVEREDRATIO</value> <minimum>${allowed.coverage}</minimum> </limit> <limit implementation="org.jacoco.report.check.Limit"> <counter>BRANCH</counter> <value>COVEREDRATIO</value> <minimum>${allowed.branches}</minimum> </limit> <limit implementation="org.jacoco.report.check.Limit"> <counter>CLASS</counter> <value>MISSEDCOUNT</value> <maximum>${allowed.classes}</maximum> </limit> <limit implementation="org.jacoco.report.check.Limit"> <counter>METHOD</counter> <value>MISSEDCOUNT</value> <maximum>${allowed.methods}</maximum> </limit> </limits> </rule> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>