Maven Headaches


#1

Hi guys - getting back into Clojure after some necessary time in Swift and running into a maven headache I’ve been unable to solve either on my own or with extensive S.O. searching.

Trying to include this code in my project.clj:

http://repo1.maven.org/maven2/ca/uhn/hapi/fhir/hapi-fhir/

project.clj includes [ca.uhn.hapi.fhir/hapi-fhir “1.4”]

But all attempts with both maven and leiningen I get errors (below). I’ve looked through my 3 clojure books with no help and this seems straightforward.

~/Code/Hugo/fhirtest/ lein deps                                                                                                                                             [12:27:17]
Could not find artifact ca.uhn.hapi.fhir:hapi-fhir:jar:1.4 in central (https://repo1.maven.org/maven2/)
Could not find artifact ca.uhn.hapi.fhir:hapi-fhir:jar:1.4 in clojars (https://clojars.org/repo/)
Could not find artifact ca.uhn.hapi.fhir:hapi-fhir:jar:1.4 in sonatype snapshots (https://oss.sonatype.org/content/repositories/snapshots)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

Was wondering if it might be that there is no Jar there. Any canonical resources out there on integrating maven?


#2

Hi Kevin,

Thanks for the question! These are great. I actually didn’t know the answer to this (has never come up for me) so it was fun doing the research.

I’ve dug into this and I think you’re right: there’s no JAR to download for that particular package. It’s basically an empty package used to define other things that should be pulled in.

Leiningen can do this. Just change the dependency to only look at the pom file:

[ca.uhn.hapi.fhir/hapi-fhir "1.4" :extension "pom"]

Let me know how that works.

Rock on!
Eric


#3

Eric - thank you, this is great! I had actually tried to find a way to delete the post because I had thought it was a silly (dumb) question. Good to hear it wasn’t as straightforward as I had feared.

It looks like leiningen now loads, but I can’t seem to import anything. The example below shows java imports of things like import ca.uhn.fhir.model.dstu2.resource.Patient - but intellij doesn’t seem to recognize any kind of import for this. Ah, to be a newbie again… Anyhow, thank you so much for the lead!