当前位置: 首页>>代码示例>>Java>>正文


Java Repository.getId方法代码示例

本文整理汇总了Java中org.apache.maven.model.Repository.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.getId方法的具体用法?Java Repository.getId怎么用?Java Repository.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.model.Repository的用法示例。


在下文中一共展示了Repository.getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateRepositories

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private void validateRepositories(ValidatorContext ctx, Model rawModel, Model effectiveModel) {
    if (!isEmpty(rawModel.getRepositories())) {
        if (allowedRepositoriesUrl != null) {
            for (Repository r : effectiveModel.getRepositories()) {
                if (r.getId() != null && r.getId().equals("central")) {
                    continue;
                }
                if (ArrayUtils.contains(allowedRepositoriesUrl, r.getUrl())) {
                    continue;
                }
                error(ctx, effectiveModel, "contains <repository> configuration with unallowed url " + r.getUrl());
            }
        }
        else {
            error(ctx, effectiveModel, "contains <repositories> configuration");
        }
    }
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:19,代码来源:BestPracticesValidator.java

示例2: validatePluginRepositories

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private void validatePluginRepositories(ValidatorContext ctx, Model rawModel, Model effectiveModel) {
    if (!isEmpty(rawModel.getPluginRepositories())) {
        if( allowedPluginRepositoriesUrl != null ) {
            for( Repository r : effectiveModel.getPluginRepositories()) {
                if (r.getId() != null && r.getId().equals("central")) {
                    continue;
                }
                if (ArrayUtils.contains(allowedPluginRepositoriesUrl, r.getUrl())) {
                    continue;
                }
                error(ctx, effectiveModel, "contains <pluginRepository> configuration with unallowed url " + r.getUrl());
            }
        }
        else {
            error(ctx, effectiveModel, "contains <pluginRepositories> configuration");
        }
    }
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:19,代码来源:BestPracticesValidator.java

示例3: writeRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private void writeRepository(Repository repository, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (repository.getReleases() != null) {
        writeRepositoryPolicy((RepositoryPolicy) repository.getReleases(), "releases", serializer);
    }
    if (repository.getSnapshots() != null) {
        writeRepositoryPolicy((RepositoryPolicy) repository.getSnapshots(), "snapshots", serializer);
    }
    if (repository.getId() != null) {
        writeValue(serializer, "id", repository.getId(), repository);
    }
    if (repository.getName() != null) {
        writeValue(serializer, "name", repository.getName(), repository);
    }
    if (repository.getUrl() != null) {
        writeValue(serializer, "url", repository.getUrl(), repository);
    }
    if ((repository.getLayout() != null) && !repository.getLayout().equals("default")) {
        writeValue(serializer, "layout", repository.getLayout(), repository);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(repository, "", start, b.length());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:LocationAwareMavenXpp3Writer.java

示例4: buildArtifactRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public ArtifactRepository buildArtifactRepository( Repository repo )
    throws InvalidRepositoryException
{
    if ( repo != null )
    {
        String id = repo.getId();

        if ( StringUtils.isEmpty( id ) )
        {
            throw new InvalidRepositoryException( "Repository identifier missing", "" );
        }

        String url = repo.getUrl();

        if ( StringUtils.isEmpty( url ) )
        {
            throw new InvalidRepositoryException( "URL missing for repository " + id, id );
        }

        ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots() );

        ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases() );

        return createArtifactRepository( id, url, getLayout( repo.getLayout() ), snapshots, releases );
    }
    else
    {
        return null;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:31,代码来源:LegacyRepositorySystem.java

示例5: toRemoteRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public static RemoteRepository toRemoteRepository( Repository repository )
{
    RemoteRepository result =
        new RemoteRepository( repository.getId(), repository.getLayout(), repository.getUrl() );
    result.setPolicy( true, toRepositoryPolicy( repository.getSnapshots() ) );
    result.setPolicy( false, toRepositoryPolicy( repository.getReleases() ) );
    return result;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:ArtifactDescriptorUtils.java

示例6: validateRawRepositories

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private void validateRawRepositories( ModelProblemCollector problems, List<Repository> repositories, String prefix,
                                   ModelBuildingRequest request )
{
    Map<String, Repository> index = new HashMap<String, Repository>();

    for ( Repository repository : repositories )
    {
        validateStringNotEmpty( prefix + ".id", problems, Severity.ERROR, Version.V20, repository.getId(), repository );

        validateStringNotEmpty( prefix + "[" + repository.getId() + "].url", problems, Severity.ERROR, Version.V20,
                                repository.getUrl(), repository );

        String key = repository.getId();

        Repository existing = index.get( key );

        if ( existing != null )
        {
            Severity errOn30 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );

            addViolation( problems, errOn30, Version.V20, prefix + ".id", null, "must be unique: " + repository.getId() + " -> "
                + existing.getUrl() + " vs " + repository.getUrl(), repository );
        }
        else
        {
            index.put( key, repository );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:30,代码来源:DefaultModelValidator.java

示例7: addRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
@Override
public void addRepository(Repository repository) throws InvalidRepositoryException
{
	RemoteRepository remote = new RemoteRepository(repository.getId(), repository.getLayout(), repository.getUrl());
	repos.add(remote);
}
 
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:7,代码来源:RepoModelResolver.java

示例8: remote

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private RemoteRepository remote(Repository modelRepo)
{
	return new RemoteRepository(modelRepo.getId(), modelRepo.getLayout(), modelRepo.getUrl());
}
 
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:5,代码来源:DefaultWrapperGenerator.java

示例9: toRemoteRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public static RemoteRepository toRemoteRepository(Repository repository) {
  RemoteRepository.Builder builder = new RemoteRepository.Builder(repository.getId(), repository.getLayout(), repository.getUrl());
  builder.setSnapshotPolicy(toRepositoryPolicy(repository.getSnapshots()));
  builder.setReleasePolicy(toRepositoryPolicy(repository.getReleases()));
  return builder.build();
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:7,代码来源:AetherUtils.java

示例10: buildArtifactRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public ArtifactRepository buildArtifactRepository( Repository repository )
    throws InvalidRepositoryException
{
    return new MavenArtifactRepository( repository.getId(), repository.getUrl(), new DefaultRepositoryLayout(),
                                        new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:TestRepositorySystem.java


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