1

I would like to use Apache Ivy to resolve some dependencies(imports) inside my project in Java. I'm using NetBeans 7.1.2 (Java EE version). I've installed IvyBeans plugin (version 1.2). Then I built my project and Ivy has created IvyFiles and IvyLibraries folder inside my project folder (both of them are empty). The problem is that no libraries are resolved. I obtain following message from builder:

[PATH_TO_PROJECT]\nbproject\ivy-impl.xml:92: settings file does not exist: [PATH_TO_PROJECT]\${ivy.settings.location}

This is the ivy-resolve output:

Resolving COMPILE scope ...
:: loading settings :: url = jar:file:/C:/Users/jakub/.netbeans/7.1.2/modules/ext/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: IvyThriftApp#IvyThriftApp;1.0
    confs: [compile]
:: resolution report :: resolve 6ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
Resolving PROCESSOR scope ...
:: loading settings :: url = jar:file:/C:/Users/jakub/.netbeans/7.1.2/modules/ext/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: IvyThriftApp#IvyThriftApp;1.0
    confs: [compile]
:: resolution report :: resolve 3ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
Resolving RUNTIME scope ...
:: loading settings :: url = jar:file:/C:/Users/jakub/.netbeans/7.1.2/modules/ext/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: IvyThriftApp#IvyThriftApp;1.0
    confs: [compile, runtime]
:: resolution report :: resolve 3ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
    |      runtime     |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
Resolving COMPILE_TEST scope ...
:: loading settings :: url = jar:file:/C:/Users/jakub/.netbeans/7.1.2/modules/ext/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: IvyThriftApp#IvyThriftApp;1.0
    confs: [compile, compile-test]
:: resolution report :: resolve 4ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
    |   compile-test   |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
Resolving RUNTIME_TEST scope ...
:: loading settings :: url = jar:file:/C:/Users/jakub/.netbeans/7.1.2/modules/ext/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: IvyThriftApp#IvyThriftApp;1.0
    confs: [compile, compile-test, runtime, runtime-test]
:: resolution report :: resolve 4ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
    |   compile-test   |   0   |   0   |   0   |   0   ||   0   |   0   |
    |      runtime     |   0   |   0   |   0   |   0   ||   0   |   0   |
    |   runtime-test   |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------

Is there some misunderstanding from my side of how Apache Ivy works under NetBeans or at all? My vision was that I use some dependencies inside my project - then I build it and Ivy automatically gets the dependencies from the Internet and I dont have to care about adding all external libraries into my project.

Any suggestions how to resolve this problem ?

Thank you very much for help or any recommendations :)

Reshi
  • 799
  • 4
  • 15
  • 32

1 Answers1

1

Looks like your ivy resolve is working fine. Within your build file how are using using the resolved jars to populate your ANT project's classpath?

One popular option is to call the ivy retrieve task to populate a local lib directory:

   <ivy:retrieve/>
   <path id="build.path">
      <fileset dir="lib" includes="**/*.jar"/>
   </path>

My preference and recommendation is to use ivy's cachepath task:

   <ivy:cachepath pathid="build.path"/>

A more complete example (using ivy configurations) is given here:

Ant script to choose between multiple version of classpaths

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185