use of com.buschmais.jqassistant.core.plugin.impl.AetherPluginResolverImpl in project jqa-commandline-tool by jQAssistant.
the class PluginResolverFactory method create.
/**
* Creates a {@link PluginResolver} using the given {@link CliConfiguration} providing the required {@link Plugin}s and {@link Repositories}
* <p>
* The default local repository is ~/.jqassistant/repository.
* <p>
* If no remote repository is specified the resolver will use Maven Central, see {@link #CENTRAL}.
*
* @param configuration
* The {@link CliConfiguration}.
* @return The {@link PluginResolver}.
*/
public PluginResolver create(CliConfiguration configuration) {
Repositories repositories = configuration.repositories();
File localRepository = getLocalRepository(repositories);
List<RemoteRepository> remoteRepositories = getRemoteRepositories(repositories);
RepositorySystem repositorySystem = newRepositorySystem();
log.info("Using local repository '{}' and remote repositories {}.", localRepository, remoteRepositories.stream().map(remoteRepository -> "'" + remoteRepository.getId() + " (" + remoteRepository.getUrl() + ")'").collect(joining(", ")));
RepositorySystemSession session = newRepositorySystemSession(repositorySystem, localRepository);
return new AetherPluginResolverImpl(repositorySystem, session, remoteRepositories);
}
use of com.buschmais.jqassistant.core.plugin.impl.AetherPluginResolverImpl in project jqa-maven-plugin by jQAssistant.
the class PluginRepositoryProvider method getPluginRepository.
public synchronized PluginRepository getPluginRepository(RepositorySystem repositorySystem, RepositorySystemSession repositorySystemSession, List<RemoteRepository> repositories, List<Plugin> plugins) {
if (pluginRepository == null) {
PluginResolver pluginResolver = new AetherPluginResolverImpl(repositorySystem, repositorySystemSession, repositories);
PluginClassLoader pluginClassLoader = pluginResolver.createClassLoader(Thread.currentThread().getContextClassLoader(), plugins);
// do a lazy init of the plugin repo to speed-up if the plugin execution shall be skipped
PluginConfigurationReader pluginConfigurationReader = new PluginConfigurationReaderImpl(pluginClassLoader);
this.pluginRepository = new PluginRepositoryImpl(pluginConfigurationReader);
this.pluginRepository.initialize();
}
return pluginRepository;
}
Aggregations