Bloop

Bloop

  • Install
  • Docs
  • GitHub

›Build Tools

General

  • What is Bloop
  • Integration Guide

CLI

  • CLI tutorial
  • CLI --help

Build Tools

  • Overview
  • sbt
  • Maven
  • Gradle
  • Mill

IDEs

  • Overview
  • IntelliJ
  • Metals

References

  • Debugging Reference
  • Performance guide
  • Build Server
  • Built-in Launcher
  • JSON Configuration
  • Contributing Guide
Edit

Maven

Getting Started

Configuring bloop with Maven projects speeds up developer workflows and gives you access to a modern Scala toolchain, despite Maven traditionally lacking good Scala suppport.

However, the Maven integration has a few issues that are not being actively worked on. If you're a Maven user, please help out and introduce yourself in our Discord channel or comment on one of the open Maven tickets.

Requirements

  • Your build uses scala-maven-plugin

Export your build

The Bloop plugin for Maven doesn't need to be installed, you can run bloopInstall, the task to export your Maven builds to bloop, with the following command.

$ mvn ch.epfl.scala:maven-bloop_2.13:1.5.0:bloopInstall

In some cases, when you are using generated sources in you project you might need to run:

$ mvn generate-sources ch.epfl.scala:maven-bloop_2.13:1.5.0:bloopInstall

Note that the following command uses the latest Bloop stable version 1.5.0.

Here is the list of the latest Bloop stable and development versions. If you want to be on the very latest at the cost of misbehaviors, replace the above question with the development version.

Version Published Resolver
1.5.0 28 Apr 2022 07:55 -r sonatype:releases
1.5.0-18-003e6c7b 10 May 2022 15:56 -r sonatype:releases

To build with a single Scala project foo generates two configuration files:

$ mvn ch.epfl.scala:maven-bloop_2.10:1.5.0:bloopInstall
(...)
Generated '/disk/foo/.bloop/foo.json'.
Generated '/disk/foo/.bloop/foo-test.json'.

where:

  1. foo defines the main project; and,
  2. foo-test defines the test project and depends on foo

maven-bloop generates two configuration files per Maven project. One project for the main sources and another one for the tests. Bloop will skip config file generation for those projects that are not either Java or Scala.

Verify installation and export

Verify your installation by running bloop projects in the root of the Maven workspace directory.

$ bloop projects
foo
foo-test

If the results of bloop projects is empty, check that:

  1. You are running the command-line invocation in the root base directory (e.g. /disk/foo).
  2. The Maven build export process completed successfully.
  3. The .bloop/ configuration directory contains bloop configuration files.

If you suspect bloop is loading the configuration files from somewhere else, run --verbose:

$ bloop projects --verbose
[D] Projects loaded from '/my-project/.bloop':
foo
foo-test

Here's a list of bloop commands you can run next to start playing with bloop:

  1. bloop compile --help: shows the help section for compile.
  2. bloop compile foo-test: compiles foo's src/main and src/test.
  3. bloop test foo-test -w: runs foo tests repeatedly with file watching enabled.

After verifying the export, you can continue using Bloop's command-line application or any build client integrating with Bloop, such as Metals.

Next steps after installation

Use an IDE such as Metals or IntelliJ to write code or play with the CLI if you want to explore what CLI options are available.

If you need help, you can always come over our Discord channel.

Well-known issues

Detecting Java projects

At the moment, Java projects are not being detected. Head to this ticket for a reproducible example.

← sbtGradle →
  • Getting Started
  • Requirements
  • Export your build
  • Verify installation and export
  • Next steps after installation
  • Well-known issues
    • Detecting Java projects
BloopBloop
Overview
What is BloopIntegrate with BloopBuild ToolsContributing
Build Tools
sbtGradleMavenMill
Social
Copyright © 2022 Bloop
Credits to @freepik for svg icons
Credits to Bazel, Babel and Metals for inspiring Bloop's website design