Non-standard maven repo pain with deps (dcm4che)

Hi everyone,

I’m trying to use the DICOM library dcm4che from Clojure and am getting stuck at the first step!

With the following deps.edn (macOS 15.7.2 on intel, clojure 1.12.3.1577 via brew):

{:mvn/repos {"dcm4che" {:url "https://maven.dcm4che.org"}}
 :deps {org.dcm4che/dcm4che-parent {:mvn/version "5.34.1"}}

and a completely fresh maven dir rm -rf ~/.m2, I run clj -Stree and get:

Downloading: org/clojure/clojure/1.12.3/clojure-1.12.3.pom from central
Downloading: org/clojure/spec.alpha/0.5.238/spec.alpha-0.5.238.pom from central
Downloading: org/clojure/core.specs.alpha/0.4.74/core.specs.alpha-0.4.74.pom from central
Downloading: org/clojure/pom.contrib/1.2.0/pom.contrib-1.2.0.pom from central
Downloading: org/dcm4che/dcm4che-parent/5.34.1/dcm4che-parent-5.34.1.pom from dcm4che
Downloading: org/weasis/core/weasis-core-img-bom/4.11.0/weasis-core-img-bom-4.11.0.pom from nroduit-mvn-repo-master
Downloading: org/clojure/clojure/1.12.3/clojure-1.12.3.jar from central
Downloading: org/clojure/core.specs.alpha/0.4.74/core.specs.alpha-0.4.74.jar from central
Downloading: org/clojure/spec.alpha/0.5.238/spec.alpha-0.5.238.jar from central
Error building classpath. Could not find artifact org.dcm4che:dcm4che-parent:jar:5.34.1 in central (https://repo1.maven.org/maven2/)

Why is it looking for the dcm4che-parent jar in central rather than the specificed maven repo? I had a look at the pom file in the correct repo; it seemed plausible to my non-maven-expert eyes.

(I found this similar post, but couldn’t adapt it to this problem. This maven-oriented post didn’t help either.)

The JAR was not found in the dcm4che repo - there are only POM files there. So tools.deps continued the search in the default repos, and couldn’t find the JAR there either.

The reason for there being nor JAR is that that POM has <packaging>pom</packaging>. And that type of packaging is not currently supported by tools.deps.

In order to use the relevant library from Clojure, I’d just specify dependencies on the exact libraries that you need. Those can be found under <modules> in that POM. You might need all of them, or you might need just a few.

2 Likes

You can vote for Add support for BOM (Bill Of Materials) dependencies - Clojure Q&A to help prioritize the underlying Jira issue TDEPS-202.

2 Likes

Thank you!

I get

Downloading: org/dcm4che/dcm4che-core/5.34.2/dcm4che-core-5.34.2.pom from dcm4che
Error building classpath. Failed to read artifact descriptor for org.dcm4che:dcm4che-core:jar:5.34.2
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.dcm4che:dcm4che-core:jar:5.34.2

with

 {:mvn/repos {"dcm4che" {:url "https://maven.dcm4che.org/"}}
  :deps {org.dcm4che/dcm4che-core {:mvn/version "5.34.2"}}}

which presumably uses this directory. Will keep chipping away at it.

The error that you quote is a symptom. The actual error is mentioned in its cause:

Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact org.dcm4che:dcm4che-parent:pom:5.34.2 in central (https://repo1.maven.org/maven2/)

To double-check:

$ cat ~/.m2/repository/org/dcm4che/dcm4che-core/5.34.2/dcm4che-core-5.34.2.pom | grep \<parent -A4
  <parent>
    <artifactId>dcm4che-parent</artifactId>
    <groupId>org.dcm4che</groupId>
    <version>5.34.2</version>
  </parent>

Checking further:

$ curl -s https://maven.dcm4che.org/org/dcm4che/dcm4che-parent/ | grep 5\\.34
<a href="5.34.0/">5.34.0/</a>                                            23-Jun-2025 15:59                   -
<a href="5.34.1/">5.34.1/</a>                                            16-Sep-2025 12:31                   -

Huh! So there’s a 5.34.2 version published, but the dcm4che-parent isn’t a part of that release for some reason. At least, it’s missing from the Maven repo. So I’d say that version is currently broken.

Let’s try with the previous version:

clj -Sdeps '{:mvn/repos {"dcm4che" {:url "https://maven.dcm4che.org/"}} :deps {org.dcm4che/dcm4che-core {:mvn/version "5.34.1"}}}'
Downloading: org/dcm4che/dcm4che-core/5.34.1/dcm4che-core-5.34.1.pom from dcm4che
Downloading: org/dcm4che/dcm4che-parent/5.34.1/dcm4che-parent-5.34.1.pom from dcm4che
Downloading: org/weasis/core/weasis-core-img-bom/4.11.0/weasis-core-img-bom-4.11.0.pom from nroduit-mvn-repo-master
Downloading: org/dcm4che/dcm4che-dict/5.34.1/dcm4che-dict-5.34.1.pom from dcm4che
Downloading: org/dcm4che/dcm4che-dict/5.34.1/dcm4che-dict-5.34.1.jar from dcm4che
Downloading: org/dcm4che/dcm4che-core/5.34.1/dcm4che-core-5.34.1.jar from dcm4che
Clojure 1.12.0
user=> 

:tada: :tada: :tada:

1 Like