我在尝试通过Ivy将依赖项引入我的项目时遇到问题。在我们的项目中,我们需要较旧的hibernate-search版本,它在我们的ivy.xml中定义为:
<dependency org="org.hibernate" name="hibernate-search" rev="3.4.1.Final" conf="compile->default;sources"/>
我想获取所有传递依赖,但是不幸的是,当此元素尝试解决时,遇到以下错误:
[ivy:retrieve] [NOT REQUIRED] org.hibernate#hibernate-search-analyzers;3.4.1.Final!hibernate-search-analyzers.jar
[ivy:retrieve] tried https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/lucene/lucene-core/3.1.0/lucene-core-3.1.0-tests.jar
[ivy:retrieve] CLIENT ERROR: Not Found url=https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/lucene/lucene-core/3.1.0/lucene-core-3.1.0-tests.jar
[ivy:retrieve] WARN: [NOT FOUND ] org.apache.lucene#lucene-core;3.1.0!lucene-core.jar(test-jar) (25ms)
[ivy:retrieve] WARN: ==== libs-releases: tried
[ivy:retrieve] WARN: https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/lucene/lucene-core/3.1.0/lucene-core-3.1.0-tests.jar
[ivy:retrieve] [NOT REQUIRED] org.apache.lucene#lucene-analyzers;3.1.0!lucene-analyzers.jar
[ivy:retrieve] [NOT REQUIRED] org.apache.solr#solr-analysis-extras;3.1.0!solr-analysis-extras.jar
[ivy:retrieve] tried https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/solr/solr-core/3.1.0/solr-core-3.1.0-tests.jar
[ivy:retrieve] CLIENT ERROR: Not Found url=https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/solr/solr-core/3.1.0/solr-core-3.1.0-tests.jar
[ivy:retrieve] WARN: [NOT FOUND ] org.apache.solr#solr-core;3.1.0!solr-core.jar(test-jar) (25ms)
[ivy:retrieve] WARN: ==== libs-releases: tried
[ivy:retrieve] WARN: https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/solr/solr-core/3.1.0/solr-core-3.1.0-tests.jar
最后是:
[ivy:retrieve] WARN: ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] WARN: :: FAILED DOWNLOADS ::
[ivy:retrieve] WARN: :: ^ see resolution messages for details ^ ::
[ivy:retrieve] WARN: ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] WARN: :: org.apache.lucene#lucene-core;3.1.0!lucene-core.jar(test-jar)
[ivy:retrieve] WARN: :: org.apache.solr#solr-core;3.1.0!solr-core.jar(test-jar)
[ivy:retrieve] WARN: ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] resolve done (4152ms resolve - 284ms download)
[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve] [NOT FOUND ] org.apache.lucene#lucene-core;3.1.0!lucene-core.jar(test-jar) (25ms)
[ivy:retrieve] ==== libs-releases: tried
[ivy:retrieve] https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/lucene/lucene-core/3.1.0/lucene-core-3.1.0-tests.jar
[ivy:retrieve] [NOT FOUND ] org.apache.solr#solr-core;3.1.0!solr-core.jar(test-jar) (25ms)
[ivy:retrieve] ==== libs-releases: tried
[ivy:retrieve] https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/solr/solr-core/3.1.0/solr-core-3.1.0-tests.jar
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: FAILED DOWNLOADS ::
[ivy:retrieve] :: ^ see resolution messages for details ^ ::
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: org.apache.lucene#lucene-core;3.1.0!lucene-core.jar(test-jar)
[ivy:retrieve] :: org.apache.solr#solr-core;3.1.0!solr-core.jar(test-jar)
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
.ivy2 \ cache目录中的compile.xml指出:
<module organisation="org.apache.solr" name="solr-core">
<revision name="3.1.0" status="release" pubdate="20190730111515" resolver="libs-releases" artresolver="libs-releases" homepage="" downloaded="false" searched="false" default="false" conf="master(*), compile, runtime(*), runtime, compile(*), master" position="82">
<license name="Apache 2" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<metadata-artifact status="no" details="" size="20285" time="0" location="C:\Users\someguy\.ivy2\cache\org.apache.solr\solr-core\ivy-3.1.0.xml" searched="false" original-local-location="C:\Users\someguy\.ivy2\cache\org.apache.solr\solr-core\ivy-3.1.0.xml.original" origin-is-local="false" origin-location="https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/solr/solr-core/3.1.0/solr-core-3.1.0.pom"/>
<caller organisation="org.apache.solr" name="solr-analysis-extras" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<artifacts>
<artifact name="solr-core" type="test-jar" ext="jar" extra-classifier="tests" status="failed" details="missing artifact" size="0" time="25"/>
</artifacts>
</revision>
还有:
<module organisation="org.apache.lucene" name="lucene-core">
<revision name="3.1.0" status="release" pubdate="20190730111511" resolver="libs-releases" artresolver="libs-releases" homepage="" downloaded="false" searched="false" default="false" conf="master(*), compile, runtime(*), runtime, compile(*), master" position="79">
<license name="Apache 2" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<metadata-artifact status="no" details="" size="16765" time="0" location="C:\Users\someguy\.ivy2\cache\org.apache.lucene\lucene-core\ivy-3.1.0.xml" searched="false" original-local-location="C:\Users\someguy\.ivy2\cache\org.apache.lucene\lucene-core\ivy-3.1.0.xml.original" origin-is-local="false" origin-location="https://artifactory.someserversomewhere.com/artifactory/libs-releases/org/apache/lucene/lucene-core/3.1.0/lucene-core-3.1.0.pom"/>
<caller organisation="org.apache.lucene" name="lucene-smartcn" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-stempel" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-spatial" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-memory" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.hibernate" name="hibernate-search-analyzers" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.4.1.Final"/>
<caller organisation="org.apache.lucene" name="lucene-analyzers" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.solr" name="solr-analysis-extras" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-spellchecker" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.hibernate" name="hibernate-search" conf="default, compile, runtime, master" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.4.1.Final"/>
<caller organisation="org.apache.solr" name="solr-solrj" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-highlighter" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<caller organisation="org.apache.lucene" name="lucene-misc" conf="compile, runtime" rev="3.1.0" rev-constraint-default="3.1.0" rev-constraint-dynamic="3.1.0" callerrev="3.1.0"/>
<artifacts>
<artifact name="lucene-core" type="test-jar" ext="jar" extra-classifier="tests" status="failed" details="missing artifact" size="0" time="25"/>
</artifacts>
</revision>
我的解析器如下:
<ibiblio name="libs-releases"
m2compatible="true"
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
root="https://artifactory.someserversomewhere.com/artifactory/libs-releases" />
我不明白为什么它甚至试图拉入测试罐,以及为什么无论如何都找不到它们。 如何排除这些测试罐依赖关系而无法解决?我没有运气就尝试了以下方法:
<exclude name='lucene-core' type="test-jar" ext="jar" m:classifier="tests"/>
<exclude name='solr-core' type="test-jar" ext="jar" m:classifier="tests"/>