MavenProjectLoader { public static MavenProject parseMavenPom(File pomFile) { return parseMavenPom(pomFile, false); }  static MavenProject parseMavenPom(File pomFile); static MavenProject parseMavenPom(File pomFile, boolean offline); static MavenProject parseMavenPom(InputStream pomStream); static MavenProject parseMavenPom(InputStream pomStream, boolean offline); static MavenEmbedder newMavenEmbedder(boolean offline); static MavenRequest createMavenRequest(boolean _offline); static synchronized MavenProject loadMavenProject(); static synchronized MavenProject loadMavenProject(boolean offline); static boolean isOffline(); static final String FORCE_OFFLINE; }
@Test public void shouldAddDependencyArtifactsTest() throws Exception { MavenProjectLoader.IS_FORCE_OFFLINE = true; ByteArrayInputStream targetPom = new ByteArrayInputStream(PROJ.getBytes(StandardCharsets.UTF_8)); MavenProject mavenProj = MavenProjectLoader.parseMavenPom(targetPom, true); assertEquals(1, mavenProj.getArtifacts().size()); org.apache.maven.artifact.Artifact dependencyArtifact = mavenProj.getArtifacts().iterator().next(); assertEquals(ARTIFACT_ID, dependencyArtifact.getArtifactId()); assertEquals(GROUP_ID, dependencyArtifact.getGroupId()); assertEquals(VERSION, dependencyArtifact.getVersion()); }