Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leiningen equivalent for maven dependency `type` element

I'm trying to follow this java tutorial for neo4j testing, but in Clojure. I'm using Leiningen for my dependency management, but that tutorial uses maven. According to the tutorial, maven would take the following dependency XML:

<dependencies>
  <dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-kernel</artifactId>
   <version>2.0.0</version>
   <type>test-jar</type>
   <scope>test</scope>
  </dependency>
  ...
</dependencies>

It also says:

Observe that the test-jar is crucial. Without it you would get the common neo4j-kernel jar, not the one containing the testing facilities.

I was wondering what the equivalent to this would be in my Leiningen project.clj? Obviously the main bit of it is [org.neo4j/neo4j-kernel "2.0.0"] but how do I encode the type parameter?

I've tried [org.neo4j/neo4j-kernel "2.0.0" :type "test-jar"] but that didn't work (and when I tried using :type "blah" it didn't throw an error, so I guess that parameter is ignored by Leiningen). I've also tried using :extension and :scope but again, these didn't work.

like image 851
obmarg Avatar asked Dec 26 '13 20:12

obmarg


1 Answers

Turns out the :classifier option is what I wanted:

[org.neo4j/neo4j-kernel "2.0.0" :classifier "tests"]
like image 155
obmarg Avatar answered Oct 21 '22 10:10

obmarg