本文整理汇总了Java中org.apache.maven.execution.MavenSession.getSettings方法的典型用法代码示例。如果您正苦于以下问题:Java MavenSession.getSettings方法的具体用法?Java MavenSession.getSettings怎么用?Java MavenSession.getSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.execution.MavenSession
的用法示例。
在下文中一共展示了MavenSession.getSettings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProxyConfig
import org.apache.maven.execution.MavenSession; //导入方法依赖的package包/类
static ProxyConfig getProxyConfig(MavenSession mavenSession) {
if (
mavenSession == null ||
mavenSession.getSettings() == null ||
mavenSession.getSettings().getActiveProxy() == null ||
!mavenSession.getSettings().getActiveProxy().isActive()
) {
return null;
} else {
Proxy mavenProxy = mavenSession.getSettings().getActiveProxy();
return new ProxyConfig(
mavenProxy.getProtocol(),
mavenProxy.getHost(),
mavenProxy.getPort(),
mavenProxy.getUsername(),
mavenProxy.getPassword());
}
}
示例2: getProxyConfig
import org.apache.maven.execution.MavenSession; //导入方法依赖的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);
}
}
示例3: getProxyConfig
import org.apache.maven.execution.MavenSession; //导入方法依赖的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);
}
}
示例4: getServerSettings
import org.apache.maven.execution.MavenSession; //导入方法依赖的package包/类
public Server getServerSettings(String serverId) {
MavenSession mavenSession = getMavenSession();
Settings settings = mavenSession.getSettings();
Server server = settings.getServer(serverId);
return server;
}