本文整理汇总了Java中org.apache.maven.artifact.ant.Authentication类的典型用法代码示例。如果您正苦于以下问题:Java Authentication类的具体用法?Java Authentication怎么用?Java Authentication使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Authentication类属于org.apache.maven.artifact.ant包,在下文中一共展示了Authentication类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public RemoteRepository create() {
RemoteRepository remoteRepository = new RemoteRepository();
remoteRepository.setUrl(artifactRepository.getUrl().toString());
PasswordCredentials credentials = artifactRepository.getCredentials();
String username = credentials.getUsername();
String password = credentials.getPassword();
if (username != null || password != null) {
Authentication authentication = new Authentication();
authentication.setUserName(username);
authentication.setPassword(password);
remoteRepository.addAuthentication(authentication);
}
return remoteRepository;
}
示例2: setChild
import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public void setChild(FactoryBuilderSupport builder, Object parent, Object child) {
if (child instanceof Authentication) {
getRepository(parent).addAuthentication((Authentication) child);
} else if (child instanceof Proxy) {
getRepository(parent).addProxy((Proxy) child);
} else if (child instanceof RepositoryPolicy) {
if (builder.getCurrentName().equals("snapshots")) {
getRepository(parent).addSnapshots((RepositoryPolicy) child);
} else {
getRepository(parent).addReleases((RepositoryPolicy) child);
}
}
}
示例3: RepositoryBuilder
import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
public RepositoryBuilder() {
registerFactory("repository", new RepositoryFactory(RemoteRepository.class));
registerBeanFactory("authentication", Authentication.class);
registerBeanFactory("proxy", Proxy.class);
registerBeanFactory("snapshots", RepositoryPolicy.class);
registerBeanFactory("releases", RepositoryPolicy.class);
}
示例4: updateRepositoryWithSettings
import org.apache.maven.artifact.ant.Authentication; //导入依赖的package包/类
@Override
protected void updateRepositoryWithSettings( RemoteRepository repository )
{
if ( repository.getAuthentication() == null )
{
Server server = getSettings().getServer( repository.getId() );
if ( repository.getRefid() != null && server != null)
{
RemoteRepository instance = (RemoteRepository) getProject().getReference( repository.getRefid());
instance.addAuthentication( new Authentication( server ) );
}
}
super.updateRepositoryWithSettings(repository);
}