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 Gitter channel or comment on one of the open Maven tickets.
- Your build uses
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
$ mvn ch.epfl.scala:maven-bloop_2.12:1.4.8:bloopInstall
Note that the following command uses the latest Bloop stable version 1.4.8.
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.
|1.4.8||18 Feb 2021 14:25||
|1.4.8-19-4d9f966b||09 Apr 2021 14:28||
To build with a single Scala project
foo generates two configuration files:
$ mvn ch.epfl.scala:maven-bloop_2.10:1.4.8:bloopInstall (...) Generated '/disk/foo/.bloop/foo.json'. Generated '/disk/foo/.bloop/foo-test.json'.
foodefines the main project; and,
foo-testdefines the test project and depends on
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:
- You are running the command-line invocation in the root base directory (e.g.
- The Maven build export process completed successfully.
.bloop/configuration directory contains bloop configuration files.
If you suspect bloop is loading the configuration files from somewhere else, run
$ 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:
bloop compile --help: shows the help section for compile.
bloop compile foo-test: compiles foo's
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
If you need help, you can always come over our Gitter channel.
Detecting Java projects
At the moment, Java projects are not being detected. Head to this ticket for a reproducible example.