void () { String depRoot = PathUtil.getParentPath(createFile("dep/A.java", "class A{}")); String mainRoot = PathUtil.getParentPath(createFile("main/B.java", "class B extends A{}")); JpsModule main = addModule("main", mainRoot); JpsModule dep = addModule("dep", depRoot); JpsModule dummy = addModule("dummy"); JpsModule dummy2 = addModule("dummy2"); dep.getDependenciesList().addModuleDependency(main);//force 'main' to be built before 'dep' unless transitive dependency is correctly considered main.getDependenciesList().addModuleDependency(dummy); addExportedDependency(dummy, dummy2); addExportedDependency(dummy2, dep); dummy2.getDependenciesList().addModuleDependency(dummy); //if dummy targets are completely ignored, compilation of 'main' module will fail because 'dep' module won't be compiled rebuildAllModules(); }