javaaggent demo - use javaagent and javassist to enhance bytecode
1.update pom.xml
<Premain-Class>com.poppy.premain.AgentDemo</Premain-Class>
2.package
mvn clean install
3.set agent
java -javaagent:E:\github_code\agent-demo\target\agent-demo-1.0-SNAPSHOT.jar -jar ***.jar
1.update pom.xml
<Agent-Class>com.poppy.agentmain.AgentmainAgent</Agent-Class>
2.package
mvn clean install
3.run target and dynamic attach
run com.poppy.agentmain.AgentTargetSample#main()
run com.poppy.agentmain.AgentmainAttachMain#main()