@Test public void testFillDependenciesWithPackageNames() throws Exception { final Set<String> packageNames = service.loadPackageNames( new GAV( "junit", "junit", "4.11" ) ); assertEquals( 2, packageNames.size() ); assertTrue( packageNames.contains( "org.junit.rules" ) ); assertTrue( packageNames.contains( "org.junit.matchers" ) ); }
@Override public Set<String> loadPackageNames(final GAV gav) { final Artifact artifact = getMavenRepository().resolveArtifact(gav.toString()); if (artifact != null) { return stripPackageNamesFromJar(artifact.getFile()); } else { return new HashSet<>(); } }
DependencyServiceImpl implements DependencyService { @Override public Set<String> loadPackageNames(final GAV gav) { final Artifact artifact = getMavenRepository().resolveArtifact(gav.toString()); if (artifact != null) { return stripPackageNamesFromJar(artifact.getFile()); } else { return new HashSet<>(); } } }
DependencyServiceImpl implements DependencyService { @Override public Set<String> loadPackageNames(final GAV gav) { final Artifact artifact = getMavenRepository().resolveArtifact(gav.toString()); if (artifact != null) { return stripPackageNamesFromJar(artifact.getFile()); } else { return new HashSet<>(); } } DependencyServiceImpl(); }
DependencyServiceImpl implements DependencyService { @Override public Set<String> loadPackageNames(final GAV gav) { final Artifact artifact = getMavenRepository().resolveArtifact(gav.toString()); if (artifact != null) { return stripPackageNamesFromJar(artifact.getFile()); } else { return new HashSet<>(); } } DependencyServiceImpl(); @Override Collection<Dependency> loadDependencies(final Collection<GAV> gavs); @Override Collection<Dependency> loadDependencies(final GAV gav); @Override Set<String> loadPackageNames(final GAV gav); @Override EnhancedDependencies loadEnhancedDependencies(final Collection<Dependency> dependencies); }
DependencyServiceImpl implements DependencyService { @Override public Set<String> loadPackageNames(final GAV gav) { final Artifact artifact = getMavenRepository().resolveArtifact(gav.toString()); if (artifact != null) { return stripPackageNamesFromJar(artifact.getFile()); } else { return new HashSet<>(); } } DependencyServiceImpl(); @Override Collection<Dependency> loadDependencies(final Collection<GAV> gavs); @Override Collection<Dependency> loadDependencies(final GAV gav); @Override Set<String> loadPackageNames(final GAV gav); @Override EnhancedDependencies loadEnhancedDependencies(final Collection<Dependency> dependencies);  }