本文整理汇总了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");
}
}
}
示例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");
}
}
}
示例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());
}
示例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;
}
}
示例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;
}
示例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 );
}
}
}
示例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);
}
示例8: remote
import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private RemoteRepository remote(Repository modelRepo)
{
return new RemoteRepository(modelRepo.getId(), modelRepo.getLayout(), modelRepo.getUrl());
}
示例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();
}
示例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() );
}