@Test void shouldPrioritizeGradleOverMaven() { URL gradleWithPom = GradleInfoReaderTest.class.getClassLoader().getResource(GRADLE_WITH_POM); File file = Urls.toFile(gradleWithPom); Path root = file.toPath().getParent(); Project project = FileProjectFactory.create(file); assertNotNull(project); BuildInfo info = project.getBuildInfo(); assertNotNull(info); assertEquals("gradle", info.getName()); assertEquals("jar", info.getPackaging()); assertEquals("latest", info.getVersion()); }
public static Project create(File file) { if (PROJECT != null) { return PROJECT; } synchronized (FileProjectFactory.class) { if (PROJECT == null) { PROJECT = createInternal(file); } } return PROJECT; }
FileProjectFactory { public static Project create(File file) { if (PROJECT != null) { return PROJECT; } synchronized (FileProjectFactory.class) { if (PROJECT == null) { PROJECT = createInternal(file); } } return PROJECT; } }
FileProjectFactory { public static Project create(File file) { if (PROJECT != null) { return PROJECT; } synchronized (FileProjectFactory.class) { if (PROJECT == null) { PROJECT = createInternal(file); } } return PROJECT; }  }
FileProjectFactory { public static Project create(File file) { if (PROJECT != null) { return PROJECT; } synchronized (FileProjectFactory.class) { if (PROJECT == null) { PROJECT = createInternal(file); } } return PROJECT; }  static Project create(File file); }
FileProjectFactory { public static Project create(File file) { if (PROJECT != null) { return PROJECT; } synchronized (FileProjectFactory.class) { if (PROJECT == null) { PROJECT = createInternal(file); } } return PROJECT; }  static Project create(File file);  }