Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache-Ivy:依赖关系Ivy文件_Apache_Ant_Ivy - Fatal编程技术网

Apache-Ivy:依赖关系Ivy文件

Apache-Ivy:依赖关系Ivy文件,apache,ant,ivy,Apache,Ant,Ivy,关于Apache Ivy的三个快速问题: (1) 在我们的整个项目中,我们使用了100多个“通用”jar(log4j、junit、commons cli等)。我们是否必须为它们编写ivy.xml(“module descriptor”)文件,或者在ibiblio(或其他)repo中是否有通用的文件?强迫你的用户为每个依赖项编写他们自己的常春藤文件对我来说是非常残忍和不寻常的 (2) 某个特定的JAR甚至需要ivy文件,或者ivy在repo中查找没有相应ivy文件的依赖项时是否具有默认值 (3)

关于Apache Ivy的三个快速问题:

(1) 在我们的整个项目中,我们使用了100多个“通用”jar(log4j、junit、commons cli等)。我们是否必须为它们编写ivy.xml(“module descriptor”)文件,或者在ibiblio(或其他)repo中是否有通用的文件?强迫你的用户为每个依赖项编写他们自己的常春藤文件对我来说是非常残忍和不寻常的

(2) 某个特定的JAR甚至需要ivy文件,或者ivy在repo中查找没有相应ivy文件的依赖项时是否具有默认值

(3) 是否可以将所有依赖项都放在一个文件夹(repo)中,并在其中定义一个ivy.xml文件来配置所有依赖项

谢谢你的帮助

(1)Ivy文件不必列出每个jar。一些JAR是其他JAR的依赖项,由ivy自动从存储库中提取。没有可用的默认值。对于一个新项目,我通常会生成我的第一个常春藤文件(请参阅随附的ant2ivy脚本)

(2) 只有当jar具有依赖项时,ivy存储库中才需要ivy文件。说了这么一句,拥有一个是很好的做法。就我个人而言,我欺骗并使用Maven存储库管理器来存储我的JAR

(3) 您可以在设置文件中使用文件系统解析器创建本地存储库,如下所示:

<ivysettings>
  <settings defaultResolver='maven-repos' />
  <resolvers>
    <chain name='maven-repos'>
      <ibiblio name='central' m2compatible='true' />
      <ibiblio name='spring-external' m2compatible='true' root='http://repository.springsource.com/maven/bundles/external' />
    </chain>
    <filesystem name='local'>
      <artifact pattern='/home/mark/tmp/petclinic/build/jars/[artifact]' />
    </filesystem>
  </resolvers>
  <modules>
    <module organisation='NA' name='mylibrary1.jar' resolver='local' />
    <module organisation='NA' name='mylibrary2.jar' resolver='local' />
    ..
  </modules>
</ivysettings>
脚本按如下方式运行:

groovy ant2ivy.groovy -g com.hello -a test -s targetdir/WEB-INF/lib -t build
在对示例运行时,它生成以下文件

build/build.xml
build/ivy.xml
build/ivysettings.xml
build/jars/..
..
jars目录包含在Maven repo中找不到的库

groovy ant2ivy.groovy -g com.hello -a test -s targetdir/WEB-INF/lib -t build
build/build.xml
build/ivy.xml
build/ivysettings.xml
build/jars/..
..