Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have a bit of ivy.xml which goes
<dependency org="com.atomikos" name="atomikos-util" rev="3.6.4" conf="redist->default"/>
This is being rejected due to cyclic dependencies:
impossible to resolve dependencies: java.lang.IllegalArgumentException: a module is not authorized to depend on itself: com.atomikos#atomikos-util;3.6.4 at org.apache.ivy.core.resolve.IvyNodeCallers.addCaller(IvyNodeCallers.java:169) at org.apache.ivy.core.resolve.IvyNode.addCaller(IvyNode.java:1026) at org.apache.ivy.core.resolve.IvyNode.getDependencies(IvyNode.java:352) at org.apache.ivy.core.resolve.VisitNode.getDependencies(VisitNode.java:301) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:750) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:744) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:744) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:757) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:744) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:744) at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679) at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:551) at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:235) at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193) at org.apache.ivy.Ivy.resolve(Ivy.java:502) at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:244) at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397) at org.apache.tools.ant.Project.executeTarget(Project.java:1366) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1249) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:218) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Only here is the problem: atomikos doesn't depend on itself. It has a parent group which then refers down -that could be the dependency.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.atomikos</groupId> <artifactId>transactions-essentials-all</artifactId> <version>3.6.4</version> </parent> <groupId>com.atomikos</groupId> <artifactId>atomikos-util</artifactId> <version>3.6.4</version> <name>Atomikos Util</name> <dependencies> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.3</version> <scope>provided</scope> </dependencies> </project>
Does having a parent template which declares a dependency create a cycle? If so, how to workaround this?