我有Apache Ivy(版本2.4.0)和Netbeans IDE(8.0.2)的设置 . 我无法解决完整的maven项目的依赖关系(例如:org.glassfish.jersey) . Apache Ivy成功解析了更具体模块的依赖关系,如(org.glassfish.jersey.core) .
非工作示例:
<dependency org="org.glassfish.jersey" name="project" rev="2.13" conf="solrj->*"/>
工作实例:
<dependency org="org.apache.solr" name="solr-solrj" rev="5.0.0" conf="solrj->default"/>
<dependency org="org.glassfish.jersey.core" name="jersey-server" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
<dependency org="org.glassfish.jersey.core" name="jersey-client" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
<dependency org="org.glassfish.jersey.core" name="jersey-common" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
的ivy.xml
<ivy-module version="2.0">
<info organisation="org.sonatype.nexus.examples" module="simple-project" revision="1.0.0-SNAPSHOT"/>
<configurations>
<conf name="solrj" description="Jars from the SOLRJ Library Collection"/>
</configurations>
<dependencies>
<dependency org="org.glassfish.jersey" name="project" rev="2.13" conf="solrj->*"/>
<dependency org="org.apache.solr" name="solr-solrj" rev="5.0.0" conf="solrj->default"/>
</dependencies>
ivysettings.xml
<ivysettings>
<settings defaultResolver="ibiblio"/>
<resolvers>
<ibiblio name="ibiblio" m2compatible="true"/>
</resolvers>
build.xml(只是IVY部分) .
<!-- Resolve all the dependencies that we declared in the build.xml file.
Resolving means that ivy will download the jar file from the MAVEN 2 Repository
and put them under the directory that you specify in the build.xml file.
In my case this is where all the jar files will be downloaded "C:\Users\ajalgaon\Accurev\solrj\lib" -->
<target name="init">
<ivy:settings file="ivysettings.xml" />
<ivy:resolve/>
<ivy:report todir="prebuilt/ivy-report" graph="false"/>
<ivy:retrieve conf="solrj" pattern="prebuilt/jars/solrj-lib/[artifact].[ext]"/>
</target>
Apache IVY成功解析solr-solrj模块的依赖关系 . 但它并没有解决“org.glassfish.jersey”的依赖性 . Apache IVY不解析ivy.xml文件中具有属性name =“project”的任何内容的依赖关系 . 如果我需要在这里发布更多信息,请告诉我 . 非常感谢提前 .
1 回答
无法重现您的问题 .
示例
ivy.xml
build.xml