本文整理汇总了Java中org.sonatype.aether.repository.Authentication类的典型用法代码示例。如果您正苦于以下问题:Java Authentication类的具体用法?Java Authentication怎么用?Java Authentication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Authentication类属于org.sonatype.aether.repository包,在下文中一共展示了Authentication类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createRepository
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
private org.sonatype.aether.repository.RemoteRepository createRepository(RemoteRepository gradleRepo) {
org.sonatype.aether.repository.RemoteRepository repo = new org.sonatype.aether.repository.RemoteRepository("remote", gradleRepo.getLayout(), gradleRepo.getUrl());
org.apache.maven.artifact.ant.Authentication auth = gradleRepo.getAuthentication();
if (auth != null) {
repo.setAuthentication(new Authentication(auth.getUserName(), auth.getPassword(), auth.getPrivateKey(), auth.getPassphrase()));
}
org.apache.maven.artifact.ant.Proxy proxy = gradleRepo.getProxy();
if (proxy != null) {
DefaultProxySelector proxySelector = new DefaultProxySelector();
Authentication proxyAuth = new Authentication(proxy.getUserName(), proxy.getPassword());
proxySelector.add(new Proxy(proxy.getType(), proxy.getHost(), proxy.getPort(), proxyAuth), proxy.getNonProxyHosts());
repo.setProxy(proxySelector.getProxy(repo));
}
return repo;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:MavenDeployAction.java
示例2: decorate
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
@Override
public RemoteRepository decorate(RemoteRepository repo) {
loadBeesConfig();
if (proxyHost != null && proxyPort!=null) {
String proxyType = Proxy.TYPE_HTTP;
if (repo.getUrl().startsWith("https"))
proxyType = Proxy.TYPE_HTTPS;
Proxy proxy = new Proxy(proxyType, proxyHost, Integer.parseInt(proxyPort), null);
if (proxyUser != null) {
Authentication authentication = new Authentication(proxyUser, proxyPass);
proxy.setAuthentication(authentication);
}
repo.setProxy(proxy);
}
return repo;
}
开发者ID:ndeloof,项目名称:bees-cli-bootstrap,代码行数:19,代码来源:RemoteRepositoryDecoratorImpl.java
示例3: getRemoteRepositories
import org.sonatype.aether.repository.Authentication; //导入依赖的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
示例4: prepos
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
/**
* Build repositories with proxy if it is available.
* @param repos List of repositories
* @return List of repositories with proxy
*/
private Collection<RemoteRepository> prepos(
final Collection<RemoteRepository> repos
) {
final org.apache.maven.settings.Proxy proxy = this.settings()
.getActiveProxy();
if (proxy != null) {
final DefaultProxySelector selector = new DefaultProxySelector();
selector.add(
new Proxy(
proxy.getProtocol(),
proxy.getHost(),
proxy.getPort(),
new Authentication(proxy.getUsername(), proxy.getPassword())
), proxy.getNonProxyHosts()
);
for (final RemoteRepository repo : repos) {
repo.setProxy(selector.getProxy(repo));
}
}
return repos;
}
开发者ID:jcabi,项目名称:jcabi-aether,代码行数:27,代码来源:Aether.java
示例5: reps
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
/**
* Convert a list of repositories into a list of strings.
* @param repos The list of them
* @return The list of texts
*/
private static Collection<String> reps(
final Collection<RemoteRepository> repos) {
final Collection<String> texts = new ArrayList<String>(repos.size());
final StringBuilder text = new StringBuilder();
for (final RemoteRepository repo : repos) {
final Authentication auth = repo.getAuthentication();
text.setLength(0);
text.append(repo.toString());
if (auth == null) {
text.append(" without authentication");
} else {
text.append(" with ").append(auth.toString());
}
texts.add(text.toString());
}
return texts;
}
开发者ID:jcabi,项目名称:jcabi-aether,代码行数:23,代码来源:Aether.java
示例6: RepositoryAuthentication
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
/**
* Creates a new authentication with the specified properties.
* @param auth The authentication object.
*/
@SuppressWarnings("PMD.NullAssignment")
public RepositoryAuthentication(final Authentication auth) {
this.username = auth.getUsername();
if (auth.getPassword() == null) {
this.password = null;
} else {
this.password = auth.getPassword().toCharArray();
}
this.privatekeyfile = auth.getPrivateKeyFile();
if (auth.getPassphrase() == null) {
this.passphrase = null;
} else {
this.passphrase = auth.getPassphrase().toCharArray();
}
}
开发者ID:jcabi,项目名称:jcabi-aether,代码行数:20,代码来源:RepositoryAuthentication.java
示例7: getProxy
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
public Proxy getProxy() {
if (isNotBlank(proxyHost) && proxyPort != null) {
if (isNotBlank(proxyLogin)) {
return new Proxy(proxyProtocol, proxyHost, proxyPort,
new Authentication(proxyLogin, proxyPassword));
} else {
return new Proxy(proxyProtocol, proxyHost, proxyPort, null);
}
}
return null;
}
开发者ID:apache,项目名称:zeppelin,代码行数:12,代码来源:Repository.java
示例8: setProxy
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
public void setProxy(URL proxyUrl, String proxyUser, String proxyPassword) {
Authentication auth = new Authentication(proxyUser, proxyPassword);
Proxy proxy = new Proxy(proxyUrl.getProtocol(), proxyUrl.getHost(), proxyUrl.getPort(), auth);
synchronized (repos) {
for (RemoteRepository repo : repos) {
repo.setProxy(proxy);
}
}
}
开发者ID:apache,项目名称:zeppelin,代码行数:10,代码来源:AbstractDependencyResolver.java
示例9: addRepo
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
public void addRepo(String id, String url, boolean snapshot, Authentication auth, Proxy proxy) {
synchronized (repos) {
delRepo(id);
RemoteRepository rr = new RemoteRepository(id, "default", url);
rr.setPolicy(snapshot, new RepositoryPolicy(
true,
RepositoryPolicy.UPDATE_POLICY_DAILY,
RepositoryPolicy.CHECKSUM_POLICY_WARN));
rr.setAuthentication(auth);
rr.setProxy(proxy);
repos.add(rr);
}
}
开发者ID:apache,项目名称:zeppelin,代码行数:14,代码来源:AbstractDependencyResolver.java
示例10: getAuthentication
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
/**
* Get the Authentication object.
* @return The Authentication object.
*/
public Authentication getAuthentication() {
return new Authentication(
this.username,
this.password,
this.privatekeyfile,
this.passphrase
);
}
开发者ID:jcabi,项目名称:jcabi-aether,代码行数:13,代码来源:RepositoryAuthentication.java
示例11: addRepository
import org.sonatype.aether.repository.Authentication; //导入依赖的package包/类
public void addRepository(String id, String url, boolean snapshot, Authentication auth,
Proxy proxy) throws IOException {
dependencyResolver.addRepo(id, url, snapshot, auth, proxy);
saveToFile();
}
开发者ID:apache,项目名称:zeppelin,代码行数:6,代码来源:InterpreterSettingManager.java
注:本文中的org.sonatype.aether.repository.Authentication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论