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


Java RepositoryPolicy.setChecksumPolicy方法代码示例

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


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

示例1: getRemoteRepositories

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的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

示例2: getRemoteRepositories

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的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

示例3: convertToMavenPolicy

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的package包/类
private static RepositoryPolicy convertToMavenPolicy(MavenRepositoryPolicy policy) {
  RepositoryPolicy result = new RepositoryPolicy();
  result.setChecksumPolicy(policy.getChecksumPolicy());
  result.setEnabled(policy.isEnabled());
  result.setUpdatePolicy(policy.getUpdatePolicy());
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:MavenModelUtil.java

示例4: getGlobalRepositoryFromPreference

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的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

示例5: mergeRepositoryPolicy_ChecksumPolicy

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的package包/类
protected void mergeRepositoryPolicy_ChecksumPolicy( RepositoryPolicy target, RepositoryPolicy source,
                                                     boolean sourceDominant, Map<Object, Object> context )
{
    String src = source.getChecksumPolicy();
    if ( src != null )
    {
        if ( sourceDominant || target.getChecksumPolicy() == null )
        {
            target.setChecksumPolicy( src );
            target.setLocation( "checksumPolicy", source.getLocation( "checksumPolicy" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例6: getMavenReleaseRepo

import org.apache.maven.model.RepositoryPolicy; //导入方法依赖的package包/类
public MavenRepository getMavenReleaseRepo(
		String repoUrl, boolean isReleaseEnabled, boolean isSnapshotEnabled,
		InputStream pomStream
		) throws Exception {

	//PlexusContainer container = new DefaultPlexusContainer();
	//ArtifactRepositoryFactory artifactRepoFactory = container.lookup(ArtifactRepositoryFactory.class);

	DeploymentRepository releaseToRepo = new DeploymentRepository();
	releaseToRepo.setId("central"); //$NON-NLS-1$
	releaseToRepo.setLayout("default"); //$NON-NLS-1$
	releaseToRepo.setUrl(repoUrl);
	RepositoryPolicy pol = new RepositoryPolicy();
	pol.setEnabled(isReleaseEnabled);
	pol.setUpdatePolicy(ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS);
	pol.setChecksumPolicy(ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE);
	releaseToRepo.setReleases(pol);
	RepositoryPolicy pol2 = new RepositoryPolicy();
	pol2.setEnabled(isSnapshotEnabled);
	pol2.setUpdatePolicy(ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS);
	pol2.setChecksumPolicy(ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE);
	releaseToRepo.setSnapshots(pol2);

	MavenProject mavenProject = MavenProjectLoader.parseMavenPom(pomStream);

	DistributionManagement dm = new DistributionManagement();
	dm.setSnapshotRepository(releaseToRepo);
	mavenProject.setDistributionManagement(dm);

	//List<ArtifactRepository> remoteArtifactRepositories = new ArrayList<ArtifactRepository>();
	//remoteArtifactRepositories.add(releaseToRepo);
	//mavenProject.setRemoteArtifactRepositories(remoteArtifactRepositories);

	//org.apache.maven.artifact.repository.Authentication authentication
	//	= new org.apache.maven.artifact.repository.Authentication("user","pw");
	//mavenRepo.setAuthentication(authentication);

	MavenRepository repo = getMavenRepository(mavenProject);
	return repo;
}
 
开发者ID:Governance,项目名称:dtgov,代码行数:41,代码来源:MavenRepoUtil.java


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