本文整理汇总了Java中org.apache.maven.model.DistributionManagement.setSnapshotRepository方法的典型用法代码示例。如果您正苦于以下问题:Java DistributionManagement.setSnapshotRepository方法的具体用法?Java DistributionManagement.setSnapshotRepository怎么用?Java DistributionManagement.setSnapshotRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.DistributionManagement
的用法示例。
在下文中一共展示了DistributionManagement.setSnapshotRepository方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDistributionManagement
import org.apache.maven.model.DistributionManagement; //导入方法依赖的package包/类
public static void addDistributionManagement(Model pomModel) {
DistributionManagement distributionManagement = new DistributionManagement();
DeploymentRepository releaseRepo = new DeploymentRepository();
releaseRepo.setId("repo.spring.io");
releaseRepo.setName("Spring Release Repository");
releaseRepo.setUrl("https://repo.spring.io/libs-release-local");
distributionManagement.setRepository(releaseRepo);
DeploymentRepository snapshotRepo = new DeploymentRepository();
snapshotRepo.setId("repo.spring.io");
snapshotRepo.setName("Spring Snapshot Repository");
snapshotRepo.setUrl("https://repo.spring.io/libs-snapshot-local");
distributionManagement.setSnapshotRepository(snapshotRepo);
pomModel.setDistributionManagement(distributionManagement);
}
示例2: visitDistributionManagement
import org.apache.maven.model.DistributionManagement; //导入方法依赖的package包/类
private void visitDistributionManagement( ModelVisitor visitor, DistributionManagement distributionManagement )
{
DeploymentRepository repository = distributionManagement.getRepository();
if ( repository != null )
{
visitor.visitDistributionManagementRepository( repository );
visitDistributionManagementRepository( visitor, repository );
repository = visitor.replaceDistributionManagementRepository( repository );
distributionManagement.setRepository( repository );
}
DeploymentRepository snapshotRepository = distributionManagement.getSnapshotRepository();
if ( snapshotRepository != null )
{
visitor.visitDistributionManagementSnapshotRepository( snapshotRepository );
visitDistributionManagementSnapshotRepository( visitor, snapshotRepository );
snapshotRepository = visitor.replaceDistributionManagementSnapshotRepository( snapshotRepository );
distributionManagement.setSnapshotRepository( snapshotRepository );
}
Site site = distributionManagement.getSite();
if ( site != null )
{
visitor.visitDistributionManagementSite( site );
site = visitor.replaceDistributionManagementSite( site );
distributionManagement.setSite( site );
}
Relocation relocation = distributionManagement.getRelocation();
if ( relocation != null )
{
visitor.visitDistributionManagementRelocation( relocation );
relocation = visitor.replaceDistributionManagementRelocation( relocation );
distributionManagement.setRelocation( relocation );
}
}
示例3: visitProfileDistributionManagement
import org.apache.maven.model.DistributionManagement; //导入方法依赖的package包/类
private void visitProfileDistributionManagement( ModelVisitor visitor,
DistributionManagement distributionManagement )
{
DeploymentRepository repository = distributionManagement.getRepository();
if ( repository != null )
{
visitor.visitProfileDistributionManagementRepository( repository );
visitProfileDistributionManagementRepository( visitor, repository );
repository = visitor.replaceProfileDistributionManagementRepository( repository );
distributionManagement.setRepository( repository );
}
DeploymentRepository snapshotRepository = distributionManagement.getSnapshotRepository();
if ( snapshotRepository != null )
{
visitor.visitProfileDistributionManagementSnapshotRepository( snapshotRepository );
visitProfileDistributionManagementSnapshotRepository( visitor, snapshotRepository );
snapshotRepository = visitor.replaceProfileDistributionManagementSnapshotRepository( snapshotRepository );
distributionManagement.setSnapshotRepository( snapshotRepository );
}
Site site = distributionManagement.getSite();
if ( site != null )
{
visitor.visitProfileDistributionManagementSite( site );
site = visitor.replaceProfileDistributionManagementSite( site );
distributionManagement.setSite( site );
}
Relocation relocation = distributionManagement.getRelocation();
if ( relocation != null )
{
visitor.visitProfileDistributionManagementRelocation( relocation );
relocation = visitor.replaceProfileDistributionManagementRelocation( relocation );
distributionManagement.setRelocation( relocation );
}
}
示例4: getMavenReleaseRepo
import org.apache.maven.model.DistributionManagement; //导入方法依赖的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;
}