I use Leiningen to manage my CLJ project. When I want to wrap a Java library, I found that I have to introduce it to my project firstly.
How can I use a library in a Maven repo in my project?
Edit project. clj and add the dependency (the vector of project-identifying info and version) to the :dependencies vector in project. clj. The dependency declaration looks like this: [seesaw "1.4.
Maven local repository is a folder location on your machine. It gets created when you run any maven command for the first time. Maven local repository keeps your project's all dependencies (library jars, plugin jars etc.).
You just need to add it to your project.clj dependencies as any other clojure lib. The small difference is that java libraries have a groupId apart from the artifactId. For example to import the active-mq library you will need to add to your :dependencies
[org.apache.activemq/activemq-core "5.5.0"]
The first bit is the groupId, the second is the artifactId.
Also, if the library is not in the central maven repository, you will need to add the repository configuration to your project. For example, to add the sonatype snapshot repository:
:repositories {"sonartype snapshots" "https://oss.sonatype.org/content/repositories/snapshots"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With