org.apache.maven.model.Repository.setId()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.apache.maven.model.Repository.setId方法的一些代码示例,展示了Repository.setId的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.setId方法的具体详情如下:
包路径:org.apache.maven.model.Repository
类名称:Repository
方法名:setId

Repository.setId介绍

暂无

代码示例

代码示例来源:origin: apache/maven

public static org.apache.maven.model.Repository fromSettingsRepository( org.apache.maven.settings.Repository
                                    settingsRepository )
{
  org.apache.maven.model.Repository modelRepository = new org.apache.maven.model.Repository();
  modelRepository.setId( settingsRepository.getId() );
  modelRepository.setLayout( settingsRepository.getLayout() );
  modelRepository.setName( settingsRepository.getName() );
  modelRepository.setUrl( settingsRepository.getUrl() );
  modelRepository.setReleases( fromSettingsRepositoryPolicy( settingsRepository.getReleases() ) );
  modelRepository.setSnapshots( fromSettingsRepositoryPolicy( settingsRepository.getSnapshots() ) );
  return modelRepository;
}

代码示例来源:origin: apache/maven

private static Repository convertFromProfileXmlRepository( org.apache.maven.profiles.Repository profileXmlRepo )
{
  Repository repo = new Repository();
  repo.setId( profileXmlRepo.getId() );
  repo.setLayout( profileXmlRepo.getLayout() );
  repo.setName( profileXmlRepo.getName() );
  repo.setUrl( profileXmlRepo.getUrl() );
  if ( profileXmlRepo.getSnapshots() != null )
  {
    repo.setSnapshots( convertRepositoryPolicy( profileXmlRepo.getSnapshots() ) );
  }
  if ( profileXmlRepo.getReleases() != null )
  {
    repo.setReleases( convertRepositoryPolicy( profileXmlRepo.getReleases() ) );
  }
  return repo;
}

代码示例来源:origin: apache/maven

/**
 * @param settingsRepo
 * @return a repository
 */
private static org.apache.maven.model.Repository convertFromSettingsRepository( Repository settingsRepo )
{
  org.apache.maven.model.Repository repo = new org.apache.maven.model.Repository();
  repo.setId( settingsRepo.getId() );
  repo.setLayout( settingsRepo.getLayout() );
  repo.setName( settingsRepo.getName() );
  repo.setUrl( settingsRepo.getUrl() );
  if ( settingsRepo.getSnapshots() != null )
  {
    repo.setSnapshots( convertRepositoryPolicy( settingsRepo.getSnapshots() ) );
  }
  if ( settingsRepo.getReleases() != null )
  {
    repo.setReleases( convertRepositoryPolicy( settingsRepo.getReleases() ) );
  }
  return repo;
}

代码示例来源:origin: apache/maven

repository.setId( interpolatedTrimmed( parser.nextText(), "id" ) );

代码示例来源:origin: apache/maven

repository.setId( interpolatedTrimmed( parser.nextText(), "id" ) );

代码示例来源:origin: takari/polyglot-maven

public default Repository repository(String id, String name, String url, String layout, RepositoryPolicy releases, RepositoryPolicy snapshots) {
  Repository repository = new Repository();
  if (id != null) {
    repository.setId(id);
  }
  if (name != null) {
    repository.setName(name);
  }
  if (url != null) {
    repository.setUrl(url);
  }
  if (layout != null) {
    repository.setLayout(layout);
  }
  if (releases != null) {
    repository.setReleases(releases);
  }
  if (snapshots != null) {
    repository.setSnapshots(snapshots);
  }
  return repository;
}

代码示例来源:origin: takari/polyglot-maven

repository.setId( getTrimmedValue( value ) );

代码示例来源:origin: rickardoberg/neomvn

RepositoryModelResolver( File repository, String mavenRepository )
{
  this.repository = repository;
  this.mavenRepository = mavenRepository;
  Repository mainRepo = new Repository();
  mainRepo.setUrl( mavenRepository );
  mainRepo.setId( "central" );
  repositories.add(mainRepo);
}

代码示例来源:origin: takari/polyglot-maven

for (String repoUrl : repositories.getRepositories()) {
 Repository repository = new Repository();
 repository.setId(Integer.toString(repoUrl.hashCode()));
 repository.setUrl(repoUrl);
 model.addRepository(repository);

代码示例来源:origin: org.guvnor/guvnor-project-backend

private Repository fromClientModelToPom(final org.guvnor.common.services.project.model.Repository from) {
  Repository to = new Repository();
  to.setId(from.getId());
  to.setName(from.getName());
  to.setUrl(from.getUrl());
  return to;
}

代码示例来源:origin: org.kie.guvnor/guvnor-project-backend

private Repository fromClientModelToPom(org.kie.guvnor.project.model.Repository from) {
  Repository to = new Repository();
  to.setId(from.getId());
  to.setName(from.getName());
  to.setUrl(from.getUrl());
  return to;
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

private Repository getRepositoryUpdate(JsonArray pluginRepositories, int i) {
    Repository repo = new Repository();
    repo.setId(pluginRepositories.getJsonObject(i).getString("id"));
    repo.setUrl(pluginRepositories.getJsonObject(i).getString("url"));
    return repo;
  }
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

private Repository fromClientModelToPom(final MavenRepository from) {
  Repository to = new Repository();
  to.setId(from.getId());
  to.setName(from.getName());
  to.setUrl(from.getUrl());
  return to;
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-project-backend

private Repository fromClientModelToPom(org.kie.workbench.common.services.project.service.model.Repository from) {
  Repository to = new Repository();
  to.setId(from.getId());
  to.setName(from.getName());
  to.setUrl(from.getUrl());
  return to;
}

代码示例来源:origin: kiegroup/appformer

private Repository fromClientModelToPom(final MavenRepository from) {
  Repository to = new Repository();
  to.setId(from.getId());
  to.setName(from.getName());
  to.setUrl(from.getUrl());
  return to;
}

代码示例来源:origin: org.jboss.forge.addon/maven-api

public ProfileAdapter(final org.apache.maven.settings.Profile profile)
{
 setId(profile.getId());
 Activation activation = new Activation();
 setActivation(activation);
 for (org.apache.maven.settings.Repository repository : profile.getRepositories())
 {
   Repository mavenRepository = new Repository();
   mavenRepository.setId(repository.getId());
   mavenRepository.setUrl(repository.getUrl());
   getRepositories().add(mavenRepository);
 }
 setProperties(profile.getProperties());
}

代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

private static Repository asRepository(org.apache.maven.settings.Repository repository) {
  Repository mavenRepository = new Repository();
  if (repository != null) {
    mavenRepository.setId(repository.getId());
    mavenRepository.setLayout(repository.getLayout());
    mavenRepository.setName(repository.getName());
    mavenRepository.setUrl(repository.getUrl());
    mavenRepository.setReleases(asMavenRepositoryPolicy(repository.getReleases()));
    mavenRepository.setSnapshots(asMavenRepositoryPolicy(repository.getSnapshots()));
  }
  return mavenRepository;
}

代码示例来源:origin: shrinkwrap/resolver

private static Repository asRepository(org.apache.maven.settings.Repository repository) {
  Repository mavenRepository = new Repository();
  if (repository != null) {
    mavenRepository.setId(repository.getId());
    mavenRepository.setLayout(repository.getLayout());
    mavenRepository.setName(repository.getName());
    mavenRepository.setUrl(repository.getUrl());
    mavenRepository.setReleases(asMavenRepositoryPolicy(repository.getReleases()));
    mavenRepository.setSnapshots(asMavenRepositoryPolicy(repository.getSnapshots()));
  }
  return mavenRepository;
}

代码示例来源:origin: apache/maven-enforcer

private Repository createSnapshotRepository( String id, String url )
{
  Repository r = new Repository();
  r.setId( id );
  r.setUrl( url );
  RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
  snapshotPolicy.setEnabled( true );
  snapshotPolicy.setUpdatePolicy( "daily" );
  r.setSnapshots( snapshotPolicy );
  RepositoryPolicy releasePolicy = new RepositoryPolicy();
  releasePolicy.setEnabled( false );
  r.setReleases( releasePolicy );
  return r;
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

private Repository getRepository(JsonArray pluginRepositories, int i) {
  Repository repo = new Repository();
  repo.setId(pluginRepositories.getJsonObject(i).getString("id"));
  repo.setName(pluginRepositories.getJsonObject(i).getString("name"));
  repo.setUrl(pluginRepositories.getJsonObject(i).getString("url"));
  RepositoryPolicy releases = new RepositoryPolicy();
  releases.setEnabled(pluginRepositories.getJsonObject(i).getBoolean("releasesEnabled"));
  releases.setUpdatePolicy(pluginRepositories.getJsonObject(i).getString("releasesUpdatePolicy"));
  RepositoryPolicy snapshots = new RepositoryPolicy();
  snapshots.setEnabled(pluginRepositories.getJsonObject(i).getBoolean("snapshotEnabled"));
  snapshots.setUpdatePolicy(pluginRepositories.getJsonObject(i).getString("snapshotUpdatePolicy"));
  repo.setSnapshots(snapshots);
  return repo;
}

相关文章