JFrog Artifactory provides a centralized and secure repository for Go modules, allowing you to manage both public and private Go dependencies. It enhances control over Go modules, improves security through permission management, and ensures traceability. Artifactory also helps cache external Go modules and enables efficient dependency resolution across your development teams.
To configure your Go project to use JFrog Artifactory as a Go registry, follow these steps:
Set up a Go repository in JFrog Artifactory.
Modify your Go environment to point to Artifactory. Set the GOPROXY environment variable to your Artifactory Go repository:
export GOPROXY=
To publish private Go modules to JFrog Artifactory:
First, configure your GOPROXY to point to the Artifactory Go repository.
Use the go command to publish the module:
go mod tidy
go mod vendor
go mod download
After preparing the module, deploy it to Artifactory by using Artifactory’s Go repository interface or a CI/CD pipeline integrated with Artifactory.
Authentication to JFrog Artifactory can be done using API keys, access tokens, or basic authentication (username/password). You can configure your authentication using netrc:
machine
login
password
Once this is set, your Go client will be able to pull and push modules securely to and from Artifactory.
JFrog Artifactory provides full support for Go modules versioning by serving modules based on semantic versioning (v0, v1, v2, etc.). Artifactory acts as a Go proxy and resolves dependencies by retrieving modules from both local and remote repositories. It supports caching of external dependencies (from proxy.golang.org, GitHub, etc.), ensuring faster resolution and better stability by reducing external network requests.