Skip to content

Instantly share code, notes, and snippets.

@zacscoding
Last active August 25, 2017 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zacscoding/93882838e17c9145ae2d6b6606684fda to your computer and use it in GitHub Desktop.
Save zacscoding/93882838e17c9145ae2d6b6606684fda to your computer and use it in GitHub Desktop.
java_agent_pom.xml for javaagent
<!-- build with shade plugin -->
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Premain-Class>com.asm_sample.app.App</Premain-Class>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org</pattern>
<shadedPattern>com.asm_sample.deps.org</shadedPattern>
</relocation>
<relocation>
<pattern>javassist</pattern>
<shadedPattern>com.asm_sample.deps.javassist</shadedPattern>
</relocation>
<relocation>
<pattern>ch.qos.logback</pattern>
<shadedPattern>com.asm_sample.deps.ch.qos.logback</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment