GitLab Package Registry
Kreate supports publishing to the GitLab Package Registry using CI job token authentication.
How Authentication Works
GitLab CI injects three environment variables automatically into every pipeline job:
Variable | Default Env Name | Description |
|---|---|---|
CI job token |
| Short-lived token valid for the duration of the job |
Project ID |
| Numeric ID of the GitLab project |
API base URL |
| e.g. |
Kreate reads these at configuration time. If CI_JOB_TOKEN is absent (e.g. during a local build), Kreate logs a lifecycle message and skips the GitLab repository registration entirely:
This means the GitLab target is safe to leave enabled in your build file — it simply does nothing when run outside of a GitLab CI pipeline.
Enabling GitLab Publishing
GitLab Properties
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Activates the GitLab publish target |
|
|
| Logical name of the Maven repository in Gradle |
|
|
| Environment variable name for the CI job token |
|
|
| Environment variable name for the GitLab project ID |
|
|
| Environment variable name for the GitLab API v4 base URL |
Custom Environment Variable Names
If your pipeline uses non-standard variable names, override them:
Gradle Tasks
Kreate registers the repository under the name you set in name. Gradle generates a publish task for it:
Or publish all configured repositories at once:
GitLab CI Pipeline Example
The CI_JOB_TOKEN, CI_PROJECT_ID, and CI_API_V4_URL variables are injected automatically by GitLab — no manual configuration in the pipeline file is needed.
Repository URL Structure
The Maven repository URL is constructed from the GitLab environment variables:
For example, on GitLab.com with project ID 12345678:
Gradle Tasks
Kreate registers the repository under the name you set in name. Gradle generates a publish task for it automatically:
Or publish all configured repositories at once:
GitLab CI Pipeline
The CI_JOB_TOKEN, CI_PROJECT_ID, and CI_API_V4_URL variables are injected automatically by GitLab — no manual variable configuration in the pipeline file is needed.