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


Java Repository.setId方法代码示例

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


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

示例1: convertToMavenRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public static Repository convertToMavenRepository(MavenRemoteRepository repository) {
  Repository result = new Repository();
  result.setId(repository.getId());
  result.setName(repository.getName());
  result.setUrl(repository.getUrl());
  if (repository.getLayout() == null) {
    result.setLayout("default");
  } else {
    result.setLayout(repository.getLayout());
  }
  if (repository.getSnapshotsPolicy() != null) {
    result.setSnapshots(convertToMavenPolicy(repository.getSnapshotsPolicy()));
  }

  if (repository.getReleasesPolicy() != null) {
    result.setReleases(convertToMavenPolicy(repository.getReleasesPolicy()));
  }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:MavenModelUtil.java

示例2: convertFromProfileXmlRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:21,代码来源:ProfilesConversionUtils.java

示例3: getRemoteRepositories

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
protected List<ArtifactRepository> getRemoteRepositories()
    throws Exception
{
    File repoDir = new File( getBasedir(), "src/test/remote-repo" ).getAbsoluteFile();

    RepositoryPolicy policy = new RepositoryPolicy();
    policy.setEnabled( true );
    policy.setChecksumPolicy( "ignore" );
    policy.setUpdatePolicy( "always" );

    Repository repository = new Repository();
    repository.setId( RepositorySystem.DEFAULT_REMOTE_REPO_ID );
    repository.setUrl( "file://" + repoDir.toURI().getPath() );
    repository.setReleases( policy );
    repository.setSnapshots( policy );

    return Arrays.asList( repositorySystem.buildArtifactRepository( repository ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:LegacyRepositorySystemTest.java

示例4: getRemoteRepositories

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
protected List<ArtifactRepository> getRemoteRepositories()
    throws InvalidRepositoryException
{
    File repoDir = new File( getBasedir(), "src/test/remote-repo" ).getAbsoluteFile();

    RepositoryPolicy policy = new RepositoryPolicy();
    policy.setEnabled( true );
    policy.setChecksumPolicy( "ignore" );
    policy.setUpdatePolicy( "always" );

    Repository repository = new Repository();
    repository.setId( RepositorySystem.DEFAULT_REMOTE_REPO_ID );
    repository.setUrl( "file://" + repoDir.toURI().getPath() );
    repository.setReleases( policy );
    repository.setSnapshots( policy );

    return Arrays.asList( repositorySystem.buildArtifactRepository( repository ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:AbstractCoreMavenComponentTestCase.java

示例5: shouldFindBestPracticesViolation

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
@Test
public void shouldFindBestPracticesViolation() {
    Repository repository = new Repository();
    repository.setId("repo-id");
    repository.setName("repo-name");
    repository.setUrl("repo-url");

    PomBuilder pomBuilder = pom();
    pomBuilder.model().addRepository(repository);
    pomBuilder.model().addPluginRepository(repository);
    pomBuilder.create(repoFooDir);

    validationExecutor.execute(ctx);
    assertExpectedException(BestPracticesException.class, "contains <repositories> configuration");
    assertExpectedException(BestPracticesException.class, "contains <pluginRepositories> configuration");
    assertExpectedException(BestPracticesException.class, "doesn't contain <name>");
    assertExpectedException(BestPracticesException.class, "doesn't contain <description>");
    assertExpectedException(BestPracticesException.class, "doesn't contain <url>");
    assertExpectedException(BestPracticesException.class, "doesn't contain <licenses>");
    assertExpectedException(BestPracticesException.class, "doesn't contain <developers>");
    assertExpectedException(BestPracticesException.class, "doesn't contain <scm>");
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:23,代码来源:TestBestPracticesValidator.java

示例6: addUserRepository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
/** Adds a user-specified repository to the list. */
public void addUserRepository(String url) {
  Repository repository = new Repository();
  repository.setUrl(url);
  repository.setId("user-defined repository");
  repository.setName("default");
  addRepository(repository);
  this.aether.addRemoteRepository(
      new RemoteRepository.Builder("user-defined repository", "default", url).build());
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:11,代码来源:DefaultModelResolver.java

示例7: fromClientModelToPom

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:POMContentHandler.java

示例8: getGlobalRepositoryFromPreference

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
protected Repository getGlobalRepositoryFromPreference() {

		String repoURL =
		                 preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
		                                              GLOBAL_REPOSITORY_URL, null, null);
		if (repoURL != null) {
			Repository repo = new Repository();
			repo.setUrl(repoURL);
			repo.setId(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                        GLOBAL_REPOSITORY_ID, null, null));
			RepositoryPolicy releasePolicy = new RepositoryPolicy();
			String releaseEnabled =
			                        preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                     RELEASES_ENABLED, null, null);
			releasePolicy.setEnabled(releaseEnabled != null);
			releasePolicy.setUpdatePolicy(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                           RELEASES_UPDATE_POLICY, null, null));
			releasePolicy.setChecksumPolicy(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                             RELEASES_CHECKSUM_POLICY, null, null));
			repo.setReleases(releasePolicy);

			RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
			String snapshotsEnabled =
			                          preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                       SNAPSHOTS_ENABLED, null, null);
			snapshotPolicy.setEnabled(snapshotsEnabled != null);
			snapshotPolicy.setUpdatePolicy(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                            SNAPSHOTS_UPDATE_POLICY, null, null));
			snapshotPolicy.setChecksumPolicy(preferencesService.getString("org.wso2.developerstudio.eclipse.platform.ui",
			                                                              SNAPSHOTS_CHECKSUM_POLICY, null, null));
			repo.setSnapshots(snapshotPolicy);

			return repo;
		}
		return null;
	}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:37,代码来源:AbstractWSO2ProjectCreationWizard.java

示例9: updateMavenProjectWithWSO2Repository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public static void updateMavenProjectWithWSO2Repository(MavenProject mavenProject){
	Repository repo = new Repository();
	repo.setUrl("http://maven.wso2.org/nexus/content/groups/wso2-public/");
	repo.setId("wso2-maven2-repository-1");

	mavenProject.getModel().addRepository(repo);
	mavenProject.getModel().addPluginRepository(repo);
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:9,代码来源:MavenUtils.java

示例10: getMavenCentral

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
public static Repository getMavenCentral() {
  Repository repository = new Repository();
  repository.setId("central");
  repository.setName("default");
  repository.setUrl(MAVEN_CENTRAL_URL);
  return repository;
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:8,代码来源:MavenConnector.java

示例11: repository

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
private Repository repository(String id) {
    Repository repo = new Repository();
    repo.setId(id);
    repo.setName(id);
    repo.setUrl(id);
    return repo;
}
 
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:8,代码来源:TestBestPracticesValidatorAllowedRepositories.java

示例12: write

import org.apache.maven.model.Repository; //导入方法依赖的package包/类
void write(Model model) {
    Repository repository = new Repository();
    repository.setId(this.id);
    repository.setUrl(this.url);
    model.addRepository(repository);
}
 
开发者ID:PizzaCrust,项目名称:IodineToolkit,代码行数:7,代码来源:RepositoryData.java


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