问题
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.
回答1:
Turns out the :classifier
option is what I wanted:
[org.neo4j/neo4j-kernel "2.0.0" :classifier "tests"]
回答2:
:extension
corresponds to the 'type' attribute e.g.
[org.somegroup/artifact "0.1.2" :extension "pom"]
来源:https://stackoverflow.com/questions/20790713/leiningen-equivalent-for-maven-dependency-type-element