Description
The Go client works through a Git repository that hosts the Go modules source code, and does not provide a way to deploy modules to Artifactory directly. To deploy your Go module to Artifactory, you should use the JFrog CLI. If following the JFrog βSet Me Upβ guide to deploy the Go modules, you may encounter the error like:
yanxiuw@yanxiuw-mac yan-go-example % jf gp yan-go v1.0.0 --server-id rt-server 16:07:24 [π΅Info] Using go: go1.25.1 { "status": "failure", "totals": { "success": 0, "failure": 0 } } 16:07:24 [π΅Info] Trace ID for JFrog Platform logs: 33ef6edd7892bbb4 16:07:24 [π¨Error] the deployer repository is missing from the config file (/Users/yanxiuw/github.com/JFrog/project-examples/yan-go-example/.jfrog/projects/go.yaml) please run 'jf go-config' with your deployer repository information
Root Cause
The root cause of this error is that you don't set the server-id-deploy for go-config, which is missing in the current βSet Me Upβ guide, and it causes the deployer repository to be missing from the config file.
Resolution
You should set the server-id-deploy for go-config. Please follow the steps below to set up the JFrog CLI:
- Remove the config file, which for the JFrog CLI Go project, in my Mac environment is
$Project/.jfrog/projects/go.yaml
rm -f /Users/<user-name>/github.com/JFrog/project-examples/yan-go-example/.jfrog/projects/go.yaml
- Add the config server
jf c add rt-server --artifactory-url https://<artifactory-server>/artifactory --user <user-name> --password xxxxxxxxxxxx --interactive=false
- Set the go-config with server-id-resolve and server-id-deploy
jf go-config --server-id-resolve rt-server --repo-resolve yan-go --server-id-deploy rt-server --repo-deploy yan-go
Now you can check the config file has set the resolver and deployer:
yanxiuw@yanxiuw-mac yan-go-example % cat /Users/<user-name>/github.com/JFrog/project-examples/yan-go-example/.jfrog/projects/go.yaml
version: 1
type: go
resolver:
repo: yan-go
serverId: rt-server
deployer:
repo: yan-go
serverId: rt-server
- Build the Go project
jfrog rt go build
- Deploy the binary to the Artifactory
yanxiuw@yanxiuw-mac yan-go-example % jf gp v1.0.0
16:23:35 [π΅Info] Using go: go1.25.1
16:23:38 [π΅Info] Running 'go list -mod=mod -m' in /Users/yanxiuw/github.com/JFrog/project-examples/yan-go-example
16:23:38 [π΅Info] Publishing example.com/myapp to yan-go
16:23:51 [π΅Info] These files were uploaded:
π¦ yan-go
βββ π example.com
βββ π myapp
βββ π @v
βββ π v1.0.0.info
βββ π v1.0.0.mod
βββ π v1.0.0.zip
{
"status": "success",
"totals": {
"success": 3,
"failure": 0
}
}
Conclusion
After setting the server-id-deploy for JFrog CLI, we can deploy the Go Modules with JFrog CLI successfully.