|
After looking deeply into Eclipse, it seems to be the normal behaviour. The same happens with the maven classpath container.
Knowing that the only way to trigger the resolve is to configure the container, it is problematic when the container doesn't show up. So I think we should let the container disappear, but add an entry in the context menu on the project to allow the user to trigger a resolve. Adding an action on the project would be interesting (ATM the only workaround is to use the resolve all action in the toolbar).
Another way to circumvent the problem would be to add a jar in the classpath when it's actually empty. For instance a jar called empty.jar, generated on the fly, and containing no class at all. In case of errors, we could name it error.jar. It's just a trick, but it would at least avoid to have people calling multiple times "Add Ivy library" when they don't see the container appear. WDYT? I thought of that one, but it seems so dirty.
And note also that the current context menu on the classpath container is in fact bind on every classpath container. For instance, if I have a maven classpath container and an ivy one, I can right-click on the maven container, choose Edit, and then I get the editor of the ivy.xml, which is quite confusing (well, we could consider it as a feature to do some Ivy envangelism So it might be a good idea to refactor the ivy context menus too. But I am not sure how. For the record, here is the Eclipse bugzilla entry about empty containers: https://bugs.eclipse.org/bugs/show_bug.cgi?id=167682 I agree the hack I suggest is dirty. But I wonder if it isn't even worse to have the container disapear when we have an error, or even just when there's no dependency. People are really confused by this... With the trick I think people will understand much more easily. So, should we defend cleaness or ease of understanding? I don't know...
About the context menu, I agree it would be nice to have a finer grain control over when it is displayed. In Eclipse 3.4, there is now a filter option to allow to see "Empty library container".
So as there is a workaround to still be able edit the configuration of ivy container for Eclipse 3.3, I will close it as "Won't fix". Please reopen if somebody disagree. I will add some doc about it. |
||||||||||||||||||||||||||||||||||||||||||||||||||
I have tested the workaround, it make eclipse work better, even if as explain in the Maven plugin code a refresh of the project might be needed.
I cannot provide a patch as my working copy of IvyDE contains too many patch, maybe I should give a try to have a local svn-git repo.