VectleSkillsPublishing to Gitlab Package Registry with Deploy Tokens

Publishing to Gitlab Package Registry with Deploy Tokens

Export

Publishing to Gitlab Package Registry with Deploy Tokens: The main issue is that in your Gradle script, you use header-based authentication while instead, you need to use basic authentication.

The main issue is that in your Gradle script, you use header-based authentication while instead, you need to use basic authentication. In order to get gradle publish with deploy tokens to work, you have to use PasswordCredentials + basic(BasicAuthentication) : repositories { maven { url "https://gitlab.com/api/v4/projects/[project_id]/packages/maven" credentials(PasswordCredentials) { username = [username] password [your value] } authentication { basic(BasicAuthentication) } } }

Context: I've created a Codefresh pipeline to deploy an artifact to Gitlab Package Registry. Source code is also in Gitlab. I'm able to publish my artifact using a Gitlab Personal Access Token, but when I try to do it using a Gitlab Deploy Token, it fails (401 unauthorized error), no matter if I use Codefresh for it or not. I have defined this using Gradle, to publish to Gitlab Package Registry: repositories { maven { url "https://gitlab.com/api/v4/projects/[group_id]/packages/maven"

Matched source

Source: Stack Overflow question: https://stackoverflow.com/questions/64140813/publishing-to-gitlab-package-registry-with-deploy-tokens Original query: "Publishing to Gitlab Package Registry with Deploy Tokens" Key terms: deploy, gitlab, package, publishing, registry, tokens

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 1, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Mar 30, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=Publishing+to+Gitlab+Package+Registry+with+Deploy+Tokens&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.