public ClassPathEnvironment resolve() throws HeapException final ClassPathEnvironment env = new ClassPathEnvironment(); final String[] extensions = new String[] { "jar", "ear", "war", "sar", "properties" }; if (archiveArtifactRef != null) env.addArchiveArtifactRef(archiveArtifactRef); env.addAnyArtifactRef(rootRef);
@Override public final ArtifactRef getArtifactRef(final String artifactId) throws NullPointerException { Arg.checkNotNull("artifactId", artifactId); for (final ClassPathEnvironment env : artifactIds.values()) { final ArtifactRef ref = env.getArtifactRef(artifactId); if (ref != null) { return ref; } } return null; }
private static ClassPathEnvironment createResult( final PreorderNodeListGenerator generator) { final ClassPathEnvironment env = new ClassPathEnvironment(); final List<DependencyNode> nodes = generator.getNodes(); // TODO: Should we copy the artifacts to a local folder? for (final DependencyNode node : nodes) { final ArtifactRef artifactRef = createArtifact(node); env.addArchiveArtifactRef(artifactRef); } // final PropertySetClassesLoader declarationLoader = // new PropertySetClassesLoader(); // final Set<Class<?>> declarations = // declarationLoader.getPropertySetTypes(urls); // // final PropertiesFilesLoader definitionLoader = new // PropertiesFilesLoader(); // final Set<String> definitions = // definitionLoader.getPropertiesFiles(urls); // // final PropertiesResources resources = // new PropertiesResources(env, declarations, definitions); // return resources; return env; }
@Override public final String addRootUrls(final ArtifactId artifactId) throws NullArgumentException, RepositoryException, CompoundConfigurationException { Arg.checkNotNull("artifactId", artifactId); final ResourceRepositoryFactory factory = new ResourceRepositoryFactory(); final ResourceRepository repository = factory.create(); final ClassPathEnvironment resources = repository.resolve(artifactId); synchronized (artifactIds) { artifactIds.put(artifactId, resources); } final List<URL> urls = resources.getUrls(); addRootLocations(urls); return repository.getRemoteRepositoryUrl(); }
final List<ArtifactRef> artifactRefs = env.getArtifactRefs(); if (artifactRefs.isEmpty())