ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Widmer <tom.wid...@gmail.com>
Subject Problem with module depending on self
Date Wed, 04 Feb 2009 19:46:22 GMT
If a module depends on itself (module name matches), an exception is
thrown in Ivy, and resolve fails. (the message is 'a module is not
authorized to depend on itself'). This is problematic, since there are
reasons why a module might depend on itself. e.g.

* depends on older version (e.g. to generate some kind of delta, or get
information out of it)
* depends on something different which happens to have the same module
name, but which differs in extra attributes (e.g. a custom 'component'
attribute differs between the ivy.xml and the thing it is depending on)
* other reasons?


My proposed fix is below. Is it correct?

Thanks,

Tom

Index: C:/Dev/Ivy/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
===================================================================
--- C:/Dev/Ivy/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
(revision 740786)
+++ C:/Dev/Ivy/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
(working copy)
@@ -149,7 +149,7 @@
              String[] dependencyConfs, DependencyDescriptor dd) {
          ModuleDescriptor md = callerNode.getDescriptor();
          ModuleRevisionId mrid = callerNode.getResolvedId();
-        if (mrid.getModuleId().equals(node.getId().getModuleId())) {
+        if (mrid.equals(node.getId())) {
              throw new IllegalArgumentException("a module is not
authorized to depend on itself: "
                      + node.getId());
          }


Mime
View raw message