I am attempting to create a uberjar of my java project with a dependency for the mongodb-java-driver
found here which includes the com.mongodb.*
packages.
Currently I have tried using leiningen versions 2.0.0-preview4
and 1.7.1
, and mongodb-java-driver version 2.7.3
. My project.clj dependencies appear like so:
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[org.mongodb/mongo-java-driver "2.7.3"]
[org.apache.commons/commons-math3 "3.0"]
]
While running the command lein clean && lein uberjar
I see the following output:
...
Including mongo-java-driver-2.7.3.jar
...
Upon executing the uberjar I recieve the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/mongodb/DBObject
at org.ianalexan.Topology.main(Topology.java:69)
Caused by: java.lang.ClassNotFoundException: com.mongodb.DBObject
...
Apparently, previous versions of leiningen had a problem with deleting .class files at runtime, I believe I am not using a version affected by this issue.
How can I create an uberjar that contains the com.mongodb.* dependencies?