Publishing & Private Repositories
Bleep has built-in support for publishing artifacts and resolving dependencies from private Maven repositories.
Getting started: making your build publishable
Starting from a basic bleep.yaml, you need two things: a publish config on your projects and a named resolver if publishing to a private registry.
Step 1: Add publish to your projects
The publish field marks a project as publishable. At minimum, set groupId:
projects:
mylib:
publish:
groupId: com.mycompany
Use a template to share config across projects. Test projects are automatically excluded, any project with isTestProject: true is never published, even if it inherits publish from a template.
templates:
template-common:
publish:
groupId: com.mycompany
description: Our shared libraries
url: https://github.com/mycompany/mylibs
developers:
- id: teamlead
name: Team Lead
url: https://github.com/teamlead
licenses:
- name: MIT
url: http://opensource.org/licenses/MIT
distribution: repo
projects:
mylib:
extends: template-common # published
mylib-utils:
extends: template-common # published
mylib-tests:
extends: template-common
isTestProject: true # not published (test projects are always skipped)
This means you can safely put publish in your common template without worrying about test projects leaking into your releases.
Step 2: Add a named resolver (for private repos)
If publishing to a private registry, declare it as a named resolver:
resolvers:
- name: company-releases
type: maven
uri: artifactregistry://europe-north1-maven.pkg.dev/my-project/my-repo
This resolver is used for both fetching dependencies and publishing. The name becomes a publish subcommand.
Step 3: Publish
bleep publish company-releases # all publishable projects
bleep publish company-releases mylib # specific project
Version is derived from git tags automatically. Tag with v prefix:
git tag v1.0.0
bleep publish company-releases
Command reference
bleep publish <target> [--version X] [--assert-release] [projects...]
| Target | Description |
|---|---|
local-ivy | Publish to local ~/.ivy2 cache |
sonatype | Publish to Maven Central (GPG signing + staging) |
setup | Interactive setup wizard |
| resolver-name | Publish to a named resolver from bleep.yaml |
Named resolvers appear as subcommands automatically, with tab completion and help text.
Flags
| Flag | Description |
|---|---|
--version X | Override version (default: from git tags via DynVer) |
--assert-release | Fail if git state would produce a snapshot version |
Supported providers
| Provider | Resolver scheme | CLI tool | Auth config needed |
|---|---|---|---|
| Artifactory / generic Maven | plain https:// | , | User + token in ~/.config/bleep/config.yaml |
| Google Artifact Registry | artifactregistry:// | gcloud | Account (if multiple) |
| GitHub Packages | github:// | gh | None |
| GitLab Package Registry | gitlab:// | glab | None |
| Sonatype / Maven Central | built-in | , | Env vars + GPG |
Each provider page covers both resolving and publishing in detail.