莱宁根等同于Maven依赖项`type`元素 [英] Leiningen equivalent for maven dependency `type` element

查看:69
本文介绍了莱宁根等同于Maven依赖项`type`元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循此用于Neo4j测试的Java教程,但在Clojure中使用.我正在使用Leiningen进行依赖管理,但是该教程使用了maven.根据教程,maven将采用以下依赖项XML:

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>

它也说:

观察到测试罐至关重要.没有它,您将得到普通的neo4j内核jar,而不是包含测试工具的jar.

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

我想知道在我的Leiningen project.clj中,这相当于什么?显然,它的主要部分是 [org.neo4j/neo4j-kernel"2.0.0"] ,但是如何编码 type 参数?

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?

我已经尝试过 [org.neo4j/neo4j-kernel"2.0.0":type"test-jar"] ,但是没有用(当我尝试使用:type"blah" 并没有引发错误,所以我猜这个参数被Leiningen忽略了).我也尝试过使用:extension :scope ,但是同样,这些都不起作用.

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.

推荐答案

结果是我想要的:classifier 选项:

[org.neo4j/neo4j-kernel "2.0.0" :classifier "tests"]

这篇关于莱宁根等同于Maven依赖项`type`元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆