本文整理汇总了Java中org.eclipse.aether.DefaultRepositorySystemSession.setTransferListener方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultRepositorySystemSession.setTransferListener方法的具体用法?Java DefaultRepositorySystemSession.setTransferListener怎么用?Java DefaultRepositorySystemSession.setTransferListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.aether.DefaultRepositorySystemSession
的用法示例。
在下文中一共展示了DefaultRepositorySystemSession.setTransferListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
/**
* Uses the passed Settings in order to configure and create the session
* */
public RepositorySystemSession create(){
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
session.setOffline(settings.getOffline()!=null ? settings.getOffline().booleanValue() : false);
session.setIgnoreArtifactDescriptorRepositories(true);
session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_WARN);
session.setUpdatePolicy(settings.getUpdatePolicy());
LocalRepository localRepo = new LocalRepository(settings.getLocalRepository());
session.setLocalRepositoryManager( repositorySystem.newLocalRepositoryManager( session, localRepo ) );
session.setRepositoryListener( new microsofia.boot.aether.RepositoryListener() );
session.setTransferListener( new microsofia.boot.aether.TransferListener() );
/*TODO should allow the followig to be configured via settings file? (if needed)
* session.setResolutionErrorPolicy();
session.setArtifactDescriptorPolicy(artifactDescriptorPolicy)
session.setSystemProperties(systemProperties)
session.setUserProperties(userProperties)
session.setConfigProperties(configProperties)*/
return session;
}
示例2: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(
RepositorySystem system) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils
.newSession();
// every container must have one
session.setLocalRepositoryManager(system.newLocalRepositoryManager(
session, findLocalRepository()));
// logging for the activity
PrintStream logger = new LoggerStream(LOG, Level.INFO);
session.setTransferListener(new LoggingTransferListener());
session.setRepositoryListener(new LoggingRepositoryListener());
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
// ignore checksums on smartbear
session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
return session;
}
示例3: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository("target/local-repo");
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new ConsoleTransferListener());
session.setRepositoryListener(new ConsoleRepositoryListener());
return session;
}
示例4: newSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public RepositorySystemSession newSession(RepositorySystem system, LocalRepository localRepository) {
DefaultRepositorySystemSession session;
session = MavenRepositorySystemUtils.newSession();
final LocalRepositoryManager localRepositoryManager = system.newLocalRepositoryManager(session,localRepository);
session.setLocalRepositoryManager(localRepositoryManager);
session.setTransferListener(new ConsoleTransferListener(System.out));
session.setRepositoryListener(new ConsoleRepositoryListener(System.out));
disableLocalCaching(session);
disableArtifactNotFoundCache(session);
disableHttpsCertificateCheck(session);
session.setProxySelector(proxyManager.selectProxies());
session.setReadOnly();
return session;
}
示例5: getAvailableVersions
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
@Override
public List<String> getAvailableVersions(String artifactGroup, String artifactName, List<PluginRepository> remoteRepositories) {
List<String> versions = new ArrayList<>();
try {
// TODO figure out how to force remote check
VersionRangeRequest rangeRequest = new VersionRangeRequest();
rangeRequest.setArtifact(new DefaultArtifact(artifactGroup, artifactName, "jar", "[0,)"));
if (remoteRepositories != null) {
for (PluginRepository pluginRepository : remoteRepositories) {
rangeRequest.addRepository(
new RemoteRepository.Builder(pluginRepository.getName(), "default", pluginRepository.getUrl()).build());
}
}
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
File tempDir = new File(System.getProperty("java.io.tmpdir"), "temp-local-repo");
tempDir.mkdirs();
LocalRepository localRepo = new LocalRepository(tempDir.getAbsolutePath());
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new PluginTransferListener());
session.setRepositoryListener(new PluginRepositoryListener());
VersionRangeResult rangeResult = repositorySystem.resolveVersionRange(session, rangeRequest);
if (rangeResult != null) {
List<Version> versionList = rangeResult.getVersions();
for (Version version : versionList) {
versions.add(version.toString());
}
}
FileUtils.deleteQuietly(tempDir);
} catch (VersionRangeResolutionException e) {
logger.error("", e);
}
return versions;
}
示例6: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem repositorySystem, String localRepositoryPath) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(localRepositoryPath);
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new PluginTransferListener());
session.setRepositoryListener(new PluginRepositoryListener());
return session;
}
示例7: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system,
File localRepoPath )
{
DefaultRepositorySystemSession newSession = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository( localRepoPath );
newSession.setLocalRepositoryManager( system.newLocalRepositoryManager( newSession, localRepo ) );
newSession.setTransferListener( getTransferListener() );
newSession.setRepositoryListener( repositoryListener );
return newSession;
}
示例8: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession ( final Path tempDir, final RepositorySystem system )
{
final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession ();
final LocalRepository localRepo = new LocalRepository ( tempDir.toFile () );
session.setLocalRepositoryManager ( system.newLocalRepositoryManager ( session, localRepo ) );
session.setTransferListener ( new LoggerTransferListener () );
session.setConfigProperty ( ConfigurationProperties.USER_AGENT, VersionInformation.USER_AGENT );
return session;
}
示例9: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public RepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(localRepositoryPath);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new AbstractTransferListener() {});
session.setRepositoryListener(new AbstractRepositoryListener() {});
return session;
}
示例10: createSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private static RepositorySystemSession createSession(RepositorySystem system, File baseDir) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(baseDir);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new LoggingTransferListener());
session.setRepositoryListener(new LoggingRepositoryListener());
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
return session;
}
示例11: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository(localRepositoryLocation.toAbsolutePath().toString());
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new ConsoleTransferListener());
session.setRepositoryListener(new ConsoleRepositoryListener());
return session;
}
示例12: newRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
LocalRepository localRepo = new LocalRepository("target/local-repo");
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setTransferListener(new ConsoleTransferListener());
session.setRepositoryListener(new ConsoleRepositoryListener());
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
return session;
}
示例13: setupRepoSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
public DefaultRepositorySystemSession setupRepoSession(final RepositorySystem repoSystem, final Settings settings)
{
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
session.setOffline(false);
Proxy activeProxy = settings.getActiveProxy();
if (activeProxy != null)
{
DefaultProxySelector dps = new DefaultProxySelector();
dps.add(convertFromMavenProxy(activeProxy), activeProxy.getNonProxyHosts());
session.setProxySelector(dps);
}
final DefaultMirrorSelector mirrorSelector = createMirrorSelector(settings);
final LazyAuthenticationSelector authSelector = createAuthSelector(settings, mirrorSelector);
session.setMirrorSelector(mirrorSelector);
session.setAuthenticationSelector(authSelector);
LocalRepository localRepo = new LocalRepository(new File(settings.getLocalRepository()));
session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(session, localRepo));
session.setChecksumPolicy(RepositoryPolicy.CHECKSUM_POLICY_IGNORE);
session.setCache(new DefaultRepositoryCache());
boolean cacheNotFoundArtifacts = true;
boolean cacheTransferErrors = true;
session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(cacheNotFoundArtifacts, cacheTransferErrors));
session.setWorkspaceReader(new ClasspathWorkspaceReader());
if (Boolean.getBoolean("org.apache.maven.log_transfer"))
{
session.setTransferListener(new JULMavenTransferListener());
}
return session;
}
示例14: createRepositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
private RepositorySystemSession createRepositorySystemSession(RepositorySystem system,
LocalRepository localRepository) {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepository));
session.setTransferListener(new ConsoleTransferListener());
session.setRepositoryListener(new ConsoleRepositoryListener());
session.setReadOnly();
return session;
}
示例15: repositorySystemSession
import org.eclipse.aether.DefaultRepositorySystemSession; //导入方法依赖的package包/类
@Bean
public RepositorySystemSession repositorySystemSession(RepositorySystem repositorySystem) {
// see MavenRepositorySystemUtils.newSession()
DependencySelector selector = new AndDependencySelector(
new ScopeDependencySelector("test", "provided"),
new DepthOneOptionalDependencySelector(),
new ExclusionDependencySelector());
DependencyGraphTransformer transformer = new ConflictResolver(
new NearestVersionSelector(),
new JavaScopeSelector(),
new SimpleOptionalitySelector(),
new JavaScopeDeriver());
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepository()));
session.setSystemProperties(System.getProperties());
session.setConfigProperties(System.getProperties());
session.setArtifactTypeRegistry(artifactTypeRegistry());
session.setDependencyManager(new ClassicDependencyManager());
session.setArtifactDescriptorPolicy(new SimpleArtifactDescriptorPolicy(true, true));
session.setDependencySelector(selector);
session.setDependencyGraphTransformer(transformer);
session.setTransferListener(new LogTransferListener());
session.setRepositoryListener(new LogRepositoryListener());
if (!session.getConfigProperties().containsKey(ConfigurationProperties.REQUEST_TIMEOUT)) {
session.setConfigProperty(ConfigurationProperties.REQUEST_TIMEOUT, 3 * 60 * 1000);
}
return session;
}