IvyIntegrationNotes

Conceptual question:

Supporting Ivy ways of doing things or use Ivy to do the NetBeans thing?

DK: I think the full integration should be "Ivy ways support plus NetBeans". If you create new NB project with Ivy support then anybody familiar with Ivy (on command line/notepad) should fine it straightforward to use/customize within NB. Thing is that NB UI will support just some common aspects and some (possible advanced) details will have to (or can) be configured in ivy config files by using NB XML editor with schema based CC.

Create a Library out of an Ivy file. Makes the opposite sense as well?
Ship Ivy files for IDE's existing libraries as a new volume in library.

Trigger ivy dependencies download on project opening or Ivy files editing. Refresh classpath. How do we map ivy deps to classpath though?
The download has to go through Ivy itself (no way to bypass actually, seems to be over configurable, best to ship ivy ant tasks and execute them from the IDE? will some context be lost?)

Other Ide integration

Existing projects using ivy

"Cheap" IVY integration brainstorming

DK: Just a brainstorming on easiest way of integrating ivy to NetBeans - no attempt to provide general solution for integrating remote library repositories into NB; all APIs are just sketch to integrate ivy without any thought on their general usefulness and reusability

One solution which at the moment seems to me quite simple and which solves some of the issues you've raised is to integrate Ivy as library provider. Let me describe it from UI flow point of view:

In Library Manager you click New Library and you get UI asking for library type and name. First change would be to enhancement libraries API to allow library providers provide their own UI for library creation, eg:

Backward compatibility implementation of NewLibraryCustomizer asking for library name would exist and would be used if LibraryTypeProvider does not return its own one.

Back to new library UI. We selected ivy type and remote library browser is shown, we chose a remote library and it was downloaded to ivy local repository/cache, NB library was created with name corresponding to ivy's organization_module_revision, content of library points directly to ivy cache, corresponding NB library properties are added to userdir.properties, UI customizer of such a library is readonly and can show list of files, dependencies, configurations, etc.

Any library of ivy type can be added to any project usual way. If project is sharable then jars are copied to libraries folder and has to be put into VCS.

More desirable of course would be altering project's build script with ivy tasks downloading jars instead of storing them in VCS. That can be achieved via adding two more methods to above defined LibraryTypeProvider2:

Implementation for Ivy would update project.xml, ivy.xml, build scripts as needed. On the callers side project type would have to be updated to call this interface methods (via corresponding API methods in api.Library class).

For non-sharable projects Ivy-module would update build scripts just to download binaries to ivy cache. The ivy cache location is configured in NB Options. Ivy-module startup and/or configuration panel may check whether ivy cache is uptodate and may suggest downloading and possibly updating userdir.properties if location has changed or user deleted it etc. This may require enhancing library to have not only content and name but also some meta data which are stored along the library. Otherwise ivy-module has to guess everything from library name.

For sharable projects situation is not that different. Adding global ivy type library to sharable project results (as for any other library) into copying of library content (jar files form ivy cache) to sharable folder and creating entries in nblibraries.properties. In addition to that ivy would update build scripts to not only download jars to cache but to copy them from cache to the same place as defined in nblibraries.properties.

Re. Ivy configuration - possible solution could be in terms of NB libraries: map each ivy configuration to one NB library volume. In project's properties have "Ivy panel" with table with two columns: #1 ivy library used in project; #2 combo with library configurations. Choosing a configuration for library would on implementation layer meant libs.<ivy-type-lib>.classpath=libs.<ivy-type-lib>.<chosen-configuration>