我正在使用Scala为Elasticsearch 5.0开发一个插件。 这意味着我必须将整个Elasticsearch添加为依赖项:
...
"org.elasticsearch" % "elasticsearch" % "5.0.0"
...
如果您在Maven central中看到their pom.xml,则所有外部依赖关系都是这样声明的(请注意排除):
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-memory</artifactId>
<version>6.2.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
这意味着如果我依赖Elasticsearch 5.0.0,我只依赖他们的jar但我在课程路径中没有任何必要的依赖!!!
现在:
为什么他们会&#34;排除&#34;他们的依赖关系像这样??
是否有一个SBT技巧会覆盖&#34;排除&#34;所有传递依赖?即(非常伪代码)
dependencyClasspath := dependencyClasspath.map (dep => dep.copy(exclude = Seq())
编辑:我澄清一下:项目编译正常,但我在运行时缺少类,这里是my build.sbt and error message