使用Apache Ivy和netbeans

我有一个使用netbeans开发的现有项目,我想将Apache Ivy集成到项目中。 我更新了netbeans生成的build.xml来下载ivy(如果需要)并使用它来检索依赖项。

有谁知道我如何将下载的依赖项添加到项目的构建路径,这样它将编译好,并且也不会显示接口中缺少库错误。

如果可行的话,我更愿意在不使用netbeans插件的情况下这样做。 如果没有,你会建议使用什么插件。

编辑:此外,我现在在“-pre-init”目标中执行此操作,如果它具有任何相关性。

不幸的是我不熟悉netbeans的配置文件。

以下是我用于生成Eclipse元数据文件的集成目标:

  • 的.classpath
  • 。项目

也许你可以适应它。

      import groovy.xml.MarkupBuilder // // Generate the project file // project.log("Creating .project") new File(".project").withWriter { writer -> def xml = new MarkupBuilder(writer) xml.projectDescription() { name(project.name) comment() projects() buildSpec() { buildCommand() { name("org.eclipse.jdt.core.javabuilder") arguments() } } natures() { nature("org.eclipse.jdt.core.javanature") } } } // // Generate the classpath file // // The "lib" classpathentry fields are populated using the ivy artifact report // project.log("Creating .classpath") new File(".classpath").withWriter { writer -> def xml = new MarkupBuilder(writer) xml.classpath() { classpathentry(kind:"src", path:args[0]) classpathentry(kind:"output", path:args[1]) classpathentry(kind:"con", path:"org.eclipse.jdt.launching.JRE_CONTAINER") project.references.libfiles.each { classpathentry(kind:"lib", path:it) } } }   

也许你可以尝试http://code.google.com/p/ivybeans/

如果您不想使用ivybeans插件,也许您可​​以激发自己对插件生成的不同ant任务:

https://code.google.com/p/ivybeans/source/browse/trunk/ivybeans/ivy-module/src/com/googlecode/ivybeans/module/resources/ivy-impl_.xml