void () { String file = createFile("src/A.java", "public class A {}"); String excludedFile = createFile("src/data/excluded.java", "public class excluded {}"); createFile("src/data/pkg/excluded.java", "package pkg; public class excluded {}"); JpsModule m = addModule("m"); m.addSourceRoot(JpsPathUtil.pathToUrl(PathUtil.getParentPath(file)), JavaSourceRootType.SOURCE); JpsJavaExtensionService.getInstance().getCompilerConfiguration(myProject).getCompilerExcludes().addExcludedDirectory( JpsPathUtil.pathToUrl(PathUtil.getParentPath(excludedFile)), true ); rebuildAllModules(); assertOutput(m, fs().file("A.class")); }