How do IVY users deal with idea libraries and so on?

I was wondering what are the current "best practices" for working with IVY alongside IDEA.

We currently don't use any real integration, I took a look at the plugins without really understanding how they work (jar juggler does not seem to be a "real" plugin in that it does not download anything, the ivy plugin is only useful at the beginning of a project, and the ivy importer does not seem to have a way to connect to remote repositories...).

How do you deal with the library management? And with the definition of sources? We currently are replicating the effort: we define ivy files, and we define idea project libraries which we assign to the modules.

There should definitely be a way to do this once...

9 comments

I wrote a plugin (my first) that is so horribly written I consider it fit for only my consumption. Its based in part on work done by opensymphony. I wasn't wholly satisfied with the existing Ivy plugins available for IDEA, so I stitched together my own.

My plugin resolves and populates the IDEA libraries based on JARs located in the ivy cache. It will even handle inner-module dependencies (meaning if you have two IDEA modules, "base" and "client", and the client's ivy.xml declares a dependency on "base", the plugin won't resolve it).

Feeling your pain, I can clean it up a little and turn it over to you. Over the weekend I'll post a zip file to this thread.

Funny, I wonder what JetBrains developers do. Since TeamCity now uses Ivy, I wonder if they use Ivy for their own projects, and if they do, how they setup IDEA.

Keith

0

Attached are two files. You can unzip ivy-classpath-plugin.zip to your plugins directory to install it. The other file, ivy-classpath-plugin-src.zip contains the plugin's source code. There's an Ivy configuration screen provided by the plugin -- at the very least you should define the path to your ivyconf.file (although I believe I do try to use the default ivyconf.xml if this is left undefined). The format should be the file URL (ex: file://C:/java/ivyconf.xml).

It worked well enough for me, though it wasn't without a multitude of annoyances. I have not recently evaluated some of the other ivy IDEA plugins that are available, so they may be better.

HTH! If you give this a proper home let me know.

Keith



Attachment(s):
ivy-classpath-plugin.zip
ivy-classpath-plugin-src.zip
0

Great, thank you, I'll give it a try and see if it can be completed in some way (though I have no experience with idea plugins, or real time to work on it!). I've taken a look at the plugin hosted on google, maybe parts of the ideas in that one can be integrated with yours.

0

Keith Collison schrieb:

I wrote a plugin (my first) that is so horribly written I consider it
fit for only my consumption. Its based in part on work done by
opensymphony. I wasn't wholly satisfied with the existing Ivy plugins
available for IDEA, so I stitched together my own.


I did a similar thing. I wrote the Ant files so that they create a lib
directory for each project and copy the dependencies there. Then I
wrote a plugin that provided the following features:

- scan this lib directory and synchronise the module dependencies
- recognise artifacts as being the result of another module based on a
regex and add module dependencies for them
- a registry of libraries (also based on regex) to associate source and
JavaDoc paths

So, after an "ant update-deps" (or whatever), you could just go to the
tools menu and choose "Synchronise Libraries" => done.

Unfortunately, this plugin is broken since IDEA 6.0, and I just left it
broken, because currently, I don't really need it. This might change in
the near future, however, and I might release it, if I fix it.

cu,
Raffi

--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is nothing like Shakespeare!

herzog@raffael.ch · PGP Key 5D1FF5F4 · http://www.raffael.ch/

0

I assume that the source for the upcoming Maven support will be available.
Hopefully the available APIs/extension points will allow similar functionality
for Ivy.


0

Raffael Herzog wrote:

Keith Collison schrieb:

>> I wrote a plugin (my first) that is so horribly written I consider it
>> fit for only my consumption. Its based in part on work done by
>> opensymphony. I wasn't wholly satisfied with the existing Ivy plugins
>> available for IDEA, so I stitched together my own.

I made a simple ant task that regenerated the .ipr file with a new
project level library definition that worked, although it breaks under
ant 1.7 (probably just needs a recompile).

I just found the source again for it if anyone wants a copy...

0

I made a simple ant task that regenerated the .ipr
file with a new
project level library definition that worked,
although it breaks under
ant 1.7 (probably just needs a recompile).
I just found the source again for it if anyone wants
a copy...


Yes, thanks: how did you manage source dependencies?

0

I have used this ant task under ANT 1.6.5 and it's my favorite: the other plugins were too complex to set up. You're right, it doesn't work under 1.7. Don't have the source, and the link off your page seems down. Could you maybe post it here?

Thanks a million!

0

I've just given Keith's plugin a try (see previous post) and it rocks. One bug is it doesn't like an ivy file in a path with spaces (eg, c:\documents and settings). Otherwise, works great for me! Thanks!!!

0

Please sign in to leave a comment.