com.github.ferstl.jarscan.JarScanMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
A Maven plugin that scans the project artifact and its dependencies for methods that cannot be inlined by the JIT
compiler. It uses the JarScan utility from the JITWatch project to do that.
See https://github.com/AdoptOpenJDK/jitwatch .
The newest version!
/*
* Copyright (c) 2015, Stefan Ferstl
* Licensed under https://raw.githubusercontent.com/ferstl/jitwatch-jarscan-maven-plugin/master/LICENSE
*/
package com.github.ferstl.jarscan;
import org.adoptopenjdk.jitwatch.jarscan.IJarScanOperation;
import org.adoptopenjdk.jitwatch.jarscan.freqinlinesize.FreqInlineSizeOperation;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
* Scans the project's artifact and, if enabled, it's dependencies for large methods using JITWatch's JarScan utility.
*
* @deprecated Use the goal {@code maxMethodSize} with {@code -Dlimit=325} or your previously chosen
* {@link #freqInlineSize}.
*/
@Mojo(
name = "scan",
aggregator = false,
defaultPhase = LifecyclePhase.VERIFY,
requiresDependencyCollection = ResolutionScope.TEST,
requiresDependencyResolution = ResolutionScope.TEST,
requiresDirectInvocation = false,
threadSafe = true)
@Deprecated
public class JarScanMojo extends AbstractJarScanMojo {
/**
* The value of the {@code -XX:FreqInlineSize} option. The default is 325.
*
* @since 1.0.0
*/
@Parameter(property = "freqInlineSize", defaultValue = "325")
private int freqInlineSize;
@Override
protected String validateMojoParameters() {
if (this.freqInlineSize <= 0) {
return "freqInlineSize must be > 0.";
}
return null;
}
@Override
protected IJarScanOperation createOperation() {
return new FreqInlineSizeOperation(this.freqInlineSize);
}
}