• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SettingsDecrypter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.settings.crypto.SettingsDecrypter的典型用法代码示例。如果您正苦于以下问题:Java SettingsDecrypter类的具体用法?Java SettingsDecrypter怎么用?Java SettingsDecrypter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SettingsDecrypter类属于org.apache.maven.settings.crypto包,在下文中一共展示了SettingsDecrypter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAwsKeyPair

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
static AwsKeyPair getAwsKeyPair(String serverId, String awsAccessKey, String awsSecretAccessKey,
        Settings settings, SettingsDecrypter decrypter) throws MojoExecutionException {
    final AwsKeyPair keys;
    if (serverId != null) {
        Server server = settings.getServer(serverId);
        if (server == null) {
            throw new MojoExecutionException("serverId not found in settings: " + serverId);
        } else {
            SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server);
            SettingsDecryptionResult result = decrypter.decrypt(request);
            keys = new AwsKeyPair(result.getServer().getUsername(),
                    result.getServer().getPassword());
        }
    } else {
        keys = new AwsKeyPair(awsAccessKey, awsSecretAccessKey);
    }
    return keys;
}
 
开发者ID:davidmoten,项目名称:aws-maven-plugin,代码行数:19,代码来源:Util.java


示例2: getProxyConfig

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
static ProxyConfig getProxyConfig(MavenSession mavenSession, SettingsDecrypter decrypter) {
    if (mavenSession == null ||
            mavenSession.getSettings() == null ||
            mavenSession.getSettings().getProxies() == null ||
            mavenSession.getSettings().getProxies().isEmpty()) {
        return new ProxyConfig(Collections.<ProxyConfig.Proxy>emptyList());
    } else {
        final List<Proxy> mavenProxies = mavenSession.getSettings().getProxies();

        final List<ProxyConfig.Proxy> proxies = new ArrayList<ProxyConfig.Proxy>(mavenProxies.size());

        for (Proxy mavenProxy : mavenProxies) {
            if (mavenProxy.isActive()) {
                mavenProxy = decryptProxy(mavenProxy, decrypter);
                proxies.add(new ProxyConfig.Proxy(mavenProxy.getId(), mavenProxy.getProtocol(), mavenProxy.getHost(),
                        mavenProxy.getPort(), mavenProxy.getUsername(), mavenProxy.getPassword(), mavenProxy.getNonProxyHosts()));
            }
        }

        LOGGER.info("Found proxies: {}", proxies);
        return new ProxyConfig(proxies);
    }
}
 
开发者ID:eirslett,项目名称:frontend-maven-plugin,代码行数:24,代码来源:MojoUtils.java


示例3: getProxyConfig

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
public static ProxyConfig getProxyConfig(MavenSession mavenSession, SettingsDecrypter decrypter) {
    if (mavenSession == null ||
            mavenSession.getSettings() == null ||
            mavenSession.getSettings().getProxies() == null ||
            mavenSession.getSettings().getProxies().isEmpty()) {
        return new ProxyConfig(Collections.<ProxyConfig.Proxy>emptyList());
    } else {
        final List<Proxy> mavenProxies = mavenSession.getSettings().getProxies();

        final List<ProxyConfig.Proxy> proxies = new ArrayList<>(mavenProxies.size());

        for (Proxy mavenProxy : mavenProxies) {
            if (mavenProxy.isActive()) {
                mavenProxy = decryptProxy(mavenProxy, decrypter);
                proxies.add(new ProxyConfig.Proxy(mavenProxy.getId(), mavenProxy.getProtocol(), mavenProxy.getHost(),
                        mavenProxy.getPort(), mavenProxy.getUsername(), mavenProxy.getPassword(), mavenProxy.getNonProxyHosts()));
            }
        }

        return new ProxyConfig(proxies);
    }
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:23,代码来源:MojoUtils.java


示例4: getRemoteRepositories

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
/**
 * List of remote repositories to resolve artifacts from.
 */
@Provides @Singleton
public List<RemoteRepository> getRemoteRepositories(
        SettingsDecrypter decrypter,
        ExtensionList<RemoteRepositoryDecorator> decorators) {

    List<RemoteRepository> repositories = new ArrayList<RemoteRepository>();
    MavenDependencyResolverSettings resolverSettings = new MavenDependencyResolverSettings();
    resolverSettings.setUseMavenCentral(true);
    List<RemoteRepository> repos = resolverSettings.getRemoteRepositories();
    for (RemoteRepository remoteRepository : repos) {
        Server server = resolverSettings.getSettings().getServer(remoteRepository.getId());
        if (server != null) {
            server = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server)).getServer();
            remoteRepository.setAuthentication(new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server.getPassphrase()));
        }
        repositories.add(decorate(remoteRepository, decorators));
    }
    RemoteRepository r = new RemoteRepository("cloudbees-public-release", "default", "https://repository-cloudbees.forge.cloudbees.com/public-release/");
    repositories.add(decorate(r,decorators));
    return repositories;
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:25,代码来源:RepositorySystemModule.java


示例5: getArchetypes

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
@Override
public List<Archetype> getArchetypes() {
    File root = Places.getCacheSubdirectory("mavenarchetypes"); //NOI18N
    ArrayList<Archetype> toRet = new ArrayList<Archetype>();
    MavenEmbedder embedder = EmbedderFactory.getOnlineEmbedder();
    SettingsDecryptionResult settings = embedder.lookupComponent(SettingsDecrypter.class).decrypt(new DefaultSettingsDecryptionRequest(embedder.getSettings()));
    
    for (RepositoryInfo info : RepositoryPreferences.getInstance().getRepositoryInfos()) {
        if (info.isRemoteDownloadable()) {
            File catalog = new File(new File( root, info.getId()), "archetype-catalog.xml"); //NOI18N
            boolean download = false;
            if (!catalog.exists()) {
                download = true;
            } else {
                long lastM = catalog.lastModified();
                if (lastM == 0) {
                    download = true;
                } else if (lastM - System.currentTimeMillis() > ARCHETYPE_TIMEOUT) {
                    download = true;
                }
            }
            
            if (download) {
                download(info.getId(), info.getRepositoryUrl(), catalog, settings, embedder);
            }
            
            if (catalog.exists()) {
                try {
                    toRet.addAll(CatalogRepoProvider.getArchetypes(Utilities.toURI(catalog).toURL(), info.getRepositoryUrl()));
                } catch (MalformedURLException ex) {
                    LOG.log(Level.INFO, null, ex);
                }
            }
        }
    }
    
    return toRet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:CatalogRepoProvider.java


示例6: MavenEmbedder

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
MavenEmbedder(EmbedderConfiguration configuration) throws ComponentLookupException {
    embedderConfiguration = configuration;
    plexus = configuration.getContainer();
    this.maven = (DefaultMaven) plexus.lookup(Maven.class);
    this.projectBuilder = plexus.lookup(ProjectBuilder.class);
    this.repositorySystem = plexus.lookup(RepositorySystem.class);
    this.settingsBuilder = plexus.lookup(SettingsBuilder.class);
    this.populator = plexus.lookup(MavenExecutionRequestPopulator.class);
    settingsDecrypter = plexus.lookup(SettingsDecrypter.class);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MavenEmbedder.java


示例7: decryptServer

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
static Server decryptServer(String serverId, MavenSession mavenSession, SettingsDecrypter decrypter) {
    if (StringUtils.isEmpty(serverId)) {
        return null;
    }
    Server server = mavenSession.getSettings().getServer(serverId);
    if (server != null) {
        final DefaultSettingsDecryptionRequest decryptionRequest = new DefaultSettingsDecryptionRequest(server);
        SettingsDecryptionResult decryptedResult = decrypter.decrypt(decryptionRequest);
        return decryptedResult.getServer();
    } else {
        LOGGER.warn("Could not find server '" + serverId + "' in settings.xml");
        return null;
    }
}
 
开发者ID:eirslett,项目名称:frontend-maven-plugin,代码行数:15,代码来源:MojoUtils.java


示例8: createSettingsDecrypter

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
private SettingsDecrypter createSettingsDecrypter() {
	SettingsDecrypter settingsDecrypter = new DefaultSettingsDecrypter();
	setField(DefaultSettingsDecrypter.class, "securityDispatcher", settingsDecrypter,
			new SpringBootSecDispatcher());
	return settingsDecrypter;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:MavenSettingsReader.java


示例9: createSettingsDecrypter

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
private SettingsDecrypter createSettingsDecrypter() {
    SettingsDecrypter settingsDecrypter = new DefaultSettingsDecrypter();
    setField(DefaultSettingsDecrypter.class, "securityDispatcher", settingsDecrypter,
            new SpringBootSecDispatcher());
    return settingsDecrypter;
}
 
开发者ID:igor-suhorukov,项目名称:mvn-classloader,代码行数:7,代码来源:MavenSettingsReader.java


示例10: decryptProxy

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
private static Proxy decryptProxy(Proxy proxy, SettingsDecrypter decrypter) {
    final DefaultSettingsDecryptionRequest decryptionRequest = new DefaultSettingsDecryptionRequest(proxy);
    SettingsDecryptionResult decryptedResult = decrypter.decrypt(decryptionRequest);
    return decryptedResult.getProxy();
}
 
开发者ID:eirslett,项目名称:frontend-maven-plugin,代码行数:6,代码来源:MojoUtils.java


示例11: decryptProxy

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
private static Proxy decryptProxy(Proxy proxy, SettingsDecrypter decrypter) {
    final DefaultSettingsDecryptionRequest decryptionRequest =
            new DefaultSettingsDecryptionRequest(proxy);
    SettingsDecryptionResult decryptedResult = decrypter.decrypt(decryptionRequest);
    return decryptedResult.getProxy();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:7,代码来源:MojoUtils.java


示例12: decryptor

import org.apache.maven.settings.crypto.SettingsDecrypter; //导入依赖的package包/类
@Provides @Singleton
public SettingsDecrypter decryptor(@Aether PlexusContainer aether) {
    return lookup(aether, SettingsDecrypter.class);
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:5,代码来源:RepositorySystemModule.java



注:本文中的org.apache.maven.settings.crypto.SettingsDecrypter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RobotMap类代码示例发布时间:2022-05-21
下一篇:
Java Agent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap