You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive, type-safe Go SDK for the Sonatype Central Repository API. Search, download, and publish Maven artifacts with a clean and idiomatic Go interface.
Features
🔍 Search — Search by GroupId, ArtifactId, version, SHA1, class name, fully qualified class name, tags, packaging, classifier, and full text
📦 Download — Download POM, JAR, sources, javadoc, SBOM (CycloneDX/SPDX), and other artifact files
✅ Checksum Verification — Download with official SHA1/MD5/SHA256 checksum verification from Maven Central
🏷️ Version — List versions, get latest version, compare versions, filter versions
📂 Group — Search groups, get group statistics, compare groups, search subgroups
🎯 GAV — Search by GAV coordinates, paginated listings, sorted queries
🔖 Tag — Search by tags, multiple tag search, tag prefix search
🔬 Class Search — Search by class name, fully qualified class name, package, class hierarchy, interface implementations (with highlighting support)
📄 Artifact — Search artifacts, get artifact details, compare artifacts, get artifact statistics
🏷️ Classifier — Search by classifier (sources, javadoc, tests, etc.)
🔤 Spellcheck — Get spelling suggestions for search queries
🚀 Publisher — Upload deployment bundles, check deployment status, list deployments with filtering, publish to Maven Central
// Search with spelling suggestionsartifacts, suggestions, err:=client.SearchWithSpellcheck(ctx, "commns-lang", 10, 5)
iflen(suggestions) >0 {
fmt.Printf("Did you mean: %v?\n", suggestions)
}
Custom Field List
// Only return specific fields to reduce response sizesearchRequest:=request.NewSearchRequest().
SetQuery(request.NewQuery().SetText("commons")).
SetFieldList("id,g,a,latestVersion")
Query Parser and Field Boosting
// Use edismax parser with custom field weightssearchRequest:=request.NewSearchRequest().
SetQuery(request.NewQuery().SetText("json parser")).
SetDefType("edismax").
SetQueryFields("text^20 g^5 a^10 c^3 fc^2")
Classifier Search
// Search for artifacts with a specific classifierartifacts, err:=client.SearchByClassifier(ctx, "sources", 10)
// Combine with GroupIdartifacts, err:=client.SearchByGroupAndClassifier(ctx, "org.apache.commons", "sources", 10)
// Download with official checksum verificationdata, checksum, err:=client.DownloadWithVerifiedChecksum(ctx,
"org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar",
"sha1")
// Download only the official checksum filechecksum, err:=client.DownloadChecksumFile(ctx,
"org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar",
"sha256")
API Reference
Base URLs
API
Base URL
Auth Required
Search
https://search.maven.org/solrsearch/select
No
Download
https://repo1.maven.org/maven2
No
Publisher
https://central.sonatype.com/api/v1/publisher
Yes
Supported Solr Query Fields
Field
Description
g:
GroupId
a:
ArtifactId
v:
Version
p:
Packaging (jar, pom, war, etc.)
l:
Classifier (sources, javadoc, tests, etc.)
c:
Class name (simple)
fc:
Fully qualified class name
1:
SHA-1 checksum
tags:
Tag search
id:
Artifact ID
text:
Full text search
Advanced Search Parameters
Parameter
Description
Default
exact
Enable exact matching
false
spellcheck
Enable spell checking
auto
spellcheck.count
Number of spelling suggestions
5
fl
Field list to return
Solr default
defType
Query parser type
dismax
qf
Query fields with boost weights
text^20 g^5 a^10
Deprecated APIs
⚠️ The following API endpoints are no longer available on Sonatype Central: