Fork me on GitHub

Can a tool dependency easily access its own version data? As git deps appear to need a SHA, I can’t hardcode the version.


For context, I’m building a tool that bootstraps a bb.edn file, which itself needs a dependency.

Alex Miller (Clojure team)17:01:38

as in, you are running code from the tool and want to know what version of itself that is?


Yep, that’s right. It’s so I can tell Babashka via bb.edn that this is the version of the library it should reference.

Alex Miller (Clojure team)17:01:16

there is not a public api (yet!) but this hack will work: (-> (System/getProperty "clojure.basis") slurp clojure.edn/read-string :libs (get 'org.clojure/clojure) :mvn/version)


Thanks! That appears to work!

Alex Miller (Clojure team)17:01:33

or at the end, check :git/tag , :git/sha etc


Not sure if this is "known issue" or not: in CI (and pretty much only in CI), we are seeing intermittent "Failed to read artifact" errors from the aether stuff in the CLI (stacktrace in thread). Is this the multi-threading/race condition issue?


Error building classpath. Failed to read artifact descriptor for ring:ring:jar:1.9.4
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for ring:ring:jar:1.9.4
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(
	at clojure.lang.MultiFn.invoke(
	at java.base/
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact ring:ring:pom:1.9.4 from/to clojars (): /root/.m2/repository/ring/ring/1.9.4/ring-1.9.4.pom.part (No such file or directory)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(
	... 13 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact ring:ring:pom:1.9.4 from/to clojars (): /root/.m2/repository/ring/ring/1.9.4/ring-1.9.4.pom.part (No such file or directory)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(
	... 16 more
Caused by: /root/.m2/repository/ring/ring/1.9.4/ring-1.9.4.pom.part (No such file or directory)
	at java.base/ Method)
	at java.base/
	at java.base/<init>(
	at org.eclipse.aether.internal.impl.DefaultFileProcessor.copy(
	at org.eclipse.aether.internal.impl.DefaultFileProcessor.copy(
	at org.eclipse.aether.internal.impl.DefaultFileProcessor.move(
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$
	... 21 more


Re-running the failed step nearly always succeeds (and the "failed" artifact is random from build to build).


Is our m2 saved between builds?


Mostly, yes, but it drifts as we update deps, and then BitBucket deletes and recreates the cache about every two weeks (to make it fresh again).

Alex Miller (Clojure team)23:01:10

Don't think that matches anything I've seen

Alex Miller (Clojure team)23:01:49

ring stuff will be coming from clojars right?

Alex Miller (Clojure team)23:01:12

It looks like that is in the maven stuff that downloads then copies into place and it is missing the download. Is it possible bitbucket deletes out from under you?


No. This all happens in a single step. I don't know that it is only Clojars deps -- I think I've seen it from Maven deps too -- but I'll keep a closer eye on that in future.


Good to know this isn't a known-but-supposedly-fixed issue 🙂

Alex Miller (Clojure team)23:01:16

there are general issues with Maven concurrent downloads that they've been working on for Maven 4

Alex Miller (Clojure team)23:01:44

is there any chance of concurrent processes hitting this same repo or it for sure just 1?


I'm not using -Sthreads 1 but otherwise it is just this one process.


do we know how bitbucket shares the m2 cache? if all the builds should have access to m2, what happens when multiple builds are running at once?


(found the docs, directory is just and restored after a successful build, no shared filesystem or anything like that)


We're on the latest CLI (1058).