Skip to content

luktom/maven-build-scanner

 
 

Repository files navigation

CircleCI

Maven Build Scanner

Know your build - so you can make it faster

What Is Maven Build Scanner?

Maven Build Scanner is a tool that hooks into Maven builds and produces reports and charts that breakdown the time Maven spent. These reports provide insights into your builds that can be used to tune it.

It's been designed to work with large and complex builds; ones with hundreds of modules and plugins.

At Intuit it helped take a 40m build run by hundreds of developers every day and reduce it to 4m - a 10x reduction.

Video

Inspired by Gradle Build Scan.

How Do I Use It?

Start by install the following:

  • Java 8
  • Maven 3
  • Docker
  • Node + NPM

Run:

./setup.sh

This will:

  1. Start up a Mongo database on Docker for storing data.
  2. Create a JAR for the extension and copies it into your local Maven extensions folder (on MacOS this is something like /usr/local/Cellar/maven/3.5.4/libexec/lib/ext)
  3. Build and start the NPM web application for viewing your reports (listening on port 3000).
  4. Run a quick build scan on itself so you can try out the report.

You can then view your first scan at (http://localhost:3000). The page will show:

  • A timeline of the build, so you can see how effective concurrency is being used.
  • A pie chart showing the Maven plugins that took the longest.
  • A module-by-module breakdown of tasks.
  • Links to reports on previous builds.

To create a scan for another application, do the following:

cd your-app
env MAVEN_BUILD_SCANNER=1 mvn install

You should see the following line in the Maven console output:

Open http://localhost:3000/?projectId=com.intuit:maven-build-scanner&sessionId=60acc519-ff2a-4c06-b79a-2aa23c47c861 to view your Maven build scanner results to view your Maven build scanner results

Alternative install via docker-compose and maven

  1. Checkout the project from github
  2. Run docker-compose up -d to build the server and run mongo db and the server
  3. Run mvn install to build and install the maven plugin locally
  4. Configure the maven plugin using Maven CoreExtensions by adding add the following content to .mvn/extensions.xml:
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
  <extension>
    <groupId>com.intuit</groupId>
    <artifactId>maven-build-scanner</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </extension>
</extensions>

Goto your project and run a maven build with profiling:

To create a scan for another application, do the following:

env MAVEN_BUILD_SCANNER=1 mvn install

License

Maven Build Scanner is released under the Apache 2.0 licenses. It uses junit which is licensed under EPL 1.0.

About

Know your build - so you can make it faster

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 53.3%
  • HTML 33.3%
  • JavaScript 11.2%
  • Shell 1.9%
  • Dockerfile 0.3%