JITWatch JarScan Maven Plugin

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 .

License

License

Categories

Categories

Maven Build Tools JITWatch Application Testing & Monitoring Performance analysis
GroupId

GroupId

com.github.ferstl
ArtifactId

ArtifactId

jitwatch-jarscan-maven-plugin
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

JITWatch JarScan Maven Plugin
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 .
Project URL

Project URL

https://github.com/ferstl/jitwatch-jarscan-maven-plugin
Source Code Management

Source Code Management

https://github.com/ferstl/jitwatch-jarscan-maven-plugin

Download jitwatch-jarscan-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.ferstl</groupId>
    <artifactId>jitwatch-jarscan-maven-plugin</artifactId>
    <version>1.1</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.3
org.apache.maven.shared : maven-common-artifact-filters jar 1.4
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4
org.slf4j : slf4j-api jar 1.7.7
ch.qos.logback : logback-classic jar 1.1.2
ch.qos.logback : logback-core jar 1.1.2

provided (1)

Group / Artifact Type Version
org.apache.maven : maven-core jar 3.3.3

system (1)

Group / Artifact Type Version
com.oracle » tools.jar jar 1.7

Project Modules

There are no modules declared in this project.

jitwatch-jarscan-maven-plugin

- A Maven plugin for the JITWatch JarScan Tool

Build Status Maven Central

The jitwatch-jarscan-maven-plugin integrates JITWatch's JarScan Tool with Apache Maven. It allows you to scan your projects' artifacts and their dependencies during a Maven build. The supported scan modes are:

  • maxMethodSize
  • sequenceCount
  • invokeCount
  • nextInstructionFreq
  • allocationCount
  • instructionCount
  • sequenceSearch
  • methodSizeHisto
  • methodLength

Please refer to the plugin documentation for all configuration options of this plugin.

How to use it

The plugin is available on Maven Central. So no further repository configuration is required.

Option 1: Run it directly on your project

mvn com.github.ferstl:jitwatch-jarscan-maven-plugin:<mode>

# Example
mvn com.github.ferstl:jitwatch-jarscan-maven-plugin:maxMethodSize -Dlimit=325

If you add com.github.ferstl as <pluginGroup> to your settings.xml file, you can just run:

mvn jarscan:maxMethodSize -Dlimit=325

Option 2: Integrate it into your Maven build

The plugin runs during the verify phase by default in order to be able to scan the artifact which was built in the preceding package phase.

<plugin>
  <groupId>com.github.ferstl</groupId>
  <artifactId>jitwatch-jarscan-maven-plugin</artifactId>
  <version>1.1</version>
  <executions>
    <execution>
      <id>max-method-size</id>
      <goals>
        <goal>maxMethodSize</goal>
      </goals>
      <configuration>
        <limit>325</limit>
        <packages>com.github.ferstl</packages>
        <reportFile>${project.build.directory}/jarscan-max-method-size.txt</reportFile>
      </configuration>
    </execution>
  </executions>
</plugin>

FAQ

Q: Where is the plugin documentation?

A: Here: http://ferstl.github.io/jitwatch-jarscan-maven-plugin/plugin-info.html


Q: How does this Maven plugin scan the own artifact for a project

A: The plugin runs in the verify phase of the Maven build by default. This phase is after the package phase in the build lifecycle where the JAR file for the project is crated. If you invoke the plugin directly you need to make sure to have a built project artifact in your target folder. The plugin will log a warning if no artifact is found.


Q: There are no releases or tags of JITWatch at the moment. How do you integrate it?

A: JITWatch is added to this project as Git submodule. The Maven build for this plugin will copy the classes for the JarScan Tool and makes it part of this project. Take a look at the Git repository of this project to see which revision of JITWatch is used.

Build

Build the Plugin:

# Use --recursive for the submodule
git clone --recursive [email protected]:ferstl/jitwatch-jarscan-maven-plugin.git
mvn install

# Alternatively inititialize the submodule after cloning:
git clone [email protected]:ferstl/jitwatch-jarscan-maven-plugin.git
git submodule init
git submodule update
mvn install

Create and deploy the plugin documentation:

mvn site-deploy

Create the Release:

mvn release:prepare -DpreparationGoals="clean deploy site-deploy"

(mvn release:prepare release:perform does not work because the jitWatch sumodule is not checked out during release:perform)

Versions

Version
1.1
1.0.1
1.0.0