apache/beam · error
cannot pull dev versions of JARs, please run "gradlew
Error message
cannot pull dev versions of JARs, please run "gradlew %v" to start your expansion service
What it means
getJar refuses to download JARs whose version string contains ".dev" (dev/snapshot-style versions), telling the user to build and start the expansion service locally with gradlew <target> instead. Dev-version artifacts are not published to the public repositories the downloader queries.
Solutions
- Run the suggested Gradle task locally: ./gradlew :sdks:java:extensions:<target-module>:runExpansionService (or the gradleTarget named in the error) so the JAR is cached.
- Use a released Beam version (no ".dev") so the JAR can be downloaded from Maven.
- Pre-place the built JAR in the expected cache location so jarExists finds it.
- Set up a local repository/mirror containing the dev artifact if you must use dev versions.
Example fix
// before: dev Go binary expecting auto-download version := "2.62.0.dev" // no public artifact exists // after: build the service once locally $ ./gradlew :sdks:java:container:expansion-service:shadowJar // or use a released version version := "2.62.0"
Defensive patterns
Strategy: fallback
Validate before calling
if strings.Contains(beamVersion, ".dev") {
jarPath := filepath.Join(cacheDir, expectedJarName(gradleTarget, beamVersion))
if _, err := os.Stat(jarPath); err != nil {
// build it locally first: ./gradlew <gradleTarget>
}
} Try / catch
jar, err := expansionx.GetBeamJar(gradleTarget, repo, version)
if err != nil && strings.Contains(err.Error(), "dev versions") {
return startLocalGradleExpansionService(gradleTarget) // fallback path
} Prevention
- Use released Beam versions in production pipelines.
- Pre-build dev-version expansion service JARs via gradlew before running Go pipelines from source.
- Pre-place the JAR in the expected cache path so download is skipped.
When it happens
Trigger: Using a Beam Go binary built from a dev/snapshot source (version like 2.XX.0.dev) and relying on automatic Java expansion service download (startAutomatedJavaExpansionService / xlang transforms) where the JAR is not already cached.
Common situations: Running a Beam Go pipeline built from source without first building the Java expansion service; CI using a nightly/dev Beam build; mispinned version in a custom repository that lacks dev artifacts.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- error in startAutomatedJavaExpansionService
- error in startAutomatedPythonExpansionService
- error in starting expansion service, StartService()
- failed to find open port for service, got
- mismatched number of named outputs: received
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/019f8437f506958c.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/core/runtime/xlangx/expansionx/download.go:358
}
func (j *jarGetter) getJar(gradleTarget, version string) (string, error) {
strippedTarget := dropEndOfGradleTarget(gradleTarget)
fullURL, jarName := j.getURLForBeamJar(strippedTarget, version)
err := os.MkdirAll(j.jarCache, 0700)
if err != nil {
return "", err
}
jarPath := filepath.Join(j.jarCache, jarName)
if jarExists(jarPath) {
return jarPath, nil
}
if strings.Contains(version, ".dev") {
return "", fmt.Errorf("cannot pull dev versions of JARs, please run \"gradlew %v\" to start your expansion service",
gradleTarget)
}
// Issue warning when downloading from public repositories
fullURLStr := string(fullURL)
if strings.Contains(fullURLStr, "repo.maven.apache.org") ||
strings.Contains(fullURLStr, "repo1.maven.org") ||
strings.Contains(fullURLStr, "maven.google.com") ||
strings.Contains(fullURLStr, "maven-central.storage-download.googleapis.com") {
log.Printf("WARNING: Downloading JAR file from public repository: %s. "+
"This may pose security risks or cause instability due to repository availability. Consider pre-staging dependencies or using private mirrors.", fullURLStr)
}
resp, err := http.Get(string(fullURL))
if err != nil {
return "", err
}
defer resp.Body.Close()View on GitHub (pinned to 12126d8942)