Skip to main content

Unmanaged jars

Sometimes you need to add pre-built jar files to your classpath that aren't published to a Maven repository. Common cases include proprietary SDKs, legacy libraries, or jars generated by other tools.

Bleep supports this via the jars field on projects and templates.

Basic usage

Place your jar file somewhere in your project, then reference it from bleep.yaml:

projects:
myapp:
jars: lib/helper.jar
scala:
version: 3.8.3

Paths are relative to the build root directory (where bleep.yaml lives).

Multiple jars

You can specify multiple jars as a list:

projects:
myapp:
jars:
- lib/foo.jar
- lib/bar.jar
- vendor/legacy-sdk.jar

Using with templates

The jars field works with templates like any other field. Jars from templates and projects are merged:

templates:
with-vendor-sdk:
jars: vendor/sdk.jar

projects:
myapp:
extends: with-vendor-sdk
jars: lib/extra.jar # both vendor/sdk.jar and lib/extra.jar end up on classpath

No automatic invalidation

Bleep does not track changes to unmanaged jar files. If you update a jar file in place (replacing it with a newer version at the same path), you must run bleep clean afterwards to ensure the compiler picks up the changes:

bleep clean myapp
bleep compile myapp

This is because the incremental compiler (Zinc) caches compilation results based on the classpath entries, but does not hash the contents of jar files to detect changes.