maven plugin for the asm code compile
<build>
<plugins>
...
<plugin>
<groupId>com.github.crab2died</groupId>
<artifactId>maven-asm-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<includes>**/**.class</includes>
<excludes>**/exclude/**.class</excludes>
<output>${project.build.directory}</output>
<params>
<param>
<target>packageNam.TargetClassName#targetMethodName</target>
<replacer>packageName.ReplacerClassName#replacerMethodName</replacer>
</param>
<param>
<target>packageNam.TargetClassName#targetMethodName(packageNam.ParmaClassName, packageNam.ParmaClassName)packageNam.ReturnClassName</target>
<replacer>packageName.ReplacerClassName#replacerMethodName(packageNam.ParmaClassName, packageNam.ParmaClassName)packageNam.ReturnClassName</replacer>
</param>
</params>
<asmApiVersion>ASM9</asmApiVersion>
<asmClassWriterFlags>COMPUTE_MAXS | COMPUTE_FRAMES</asmClassWriterFlags>
<asmParsingOptions>SKIP_CODE | SKIP_DEBUG</asmParsingOptions>
</configuration>
<executions>
<execution>
<id>asm-method-replacer</id>
<phase>compile</phase>
<goals>
<goal>asm-method-replacer</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
- includes: include files, default
**/**.class
- excludes: exclude files, default empty
- output: output directory, default
${project.build.directory}
- params: method replace configuration settings
- target: target method description, refer: Method Description
- replacer: replace method description, refer: Method Description
- asmApiVersion: ASM API Version,
ASM4, ASM5, ASM6, ASM7, ASM8, ASM9
, defaultASM9
- asmClassWriterFlags: ASM class writer flags,
COMPUTE_MAXS | COMPUTE_FRAMES
or empty, default empty - asmParsingOptions: ASM class reader parsing options,
SKIP_CODE | SKIP_DEBUG | SKIP_FRAMES | EXPAND_FRAMES
or empty, default empty
- method not with arguments and return:
packageNam.ClassName#methodName
- method with arguments and return:
packageNam.ClassName#methodName(packageNam.ParmaClassName, packageNam.ParmaClassName)packageNam.ReturnClassName