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


Java RepositoryPolicy类代码示例

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


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

示例1: writeRepositoryPolicy

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void writeRepositoryPolicy(RepositoryPolicy repositoryPolicy, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (repositoryPolicy.getEnabled() != null) {
        writeValue(serializer, "enabled", repositoryPolicy.getEnabled(), repositoryPolicy);
    }
    if (repositoryPolicy.getUpdatePolicy() != null) {
        writeValue(serializer, "updatePolicy", repositoryPolicy.getUpdatePolicy(), repositoryPolicy);
    }
    if (repositoryPolicy.getChecksumPolicy() != null) {
        writeValue(serializer, "checksumPolicy", repositoryPolicy.getChecksumPolicy(), repositoryPolicy);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(repositoryPolicy, "", start, b.length());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LocationAwareMavenXpp3Writer.java

示例2: visitDistributionManagementRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitDistributionManagementRepository( ModelVisitor visitor,
                                                    DeploymentRepository deploymentRepository )
{
    RepositoryPolicy releases = deploymentRepository.getReleases();
    if ( releases != null )
    {
        visitor.visitDistributionManagementRepositoryRelease( releases );
        releases = visitor.replaceDistributionManagementRepositoryRelease( releases );
        deploymentRepository.setReleases( releases );
    }

    RepositoryPolicy snapshots = deploymentRepository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitDistributionManagementRepositorySnapshot( snapshots );
        snapshots = visitor.replaceDistributionManagementRepositorySnapshot( snapshots );
        deploymentRepository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:20,代码来源:DefaultModelProcessor.java

示例3: visitDistributionManagementSnapshotRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitDistributionManagementSnapshotRepository( ModelVisitor visitor,
                                                            DeploymentRepository deploymentRepository )
{
    RepositoryPolicy releases = deploymentRepository.getReleases();
    if ( releases != null )
    {
        visitor.visitDistributionManagementSnapshotRepositoryRelease( releases );
        releases = visitor.replaceDistributionManagementSnapshotRepositoryRelease( releases );
        deploymentRepository.setReleases( releases );
    }

    RepositoryPolicy snapshots = deploymentRepository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitDistributionManagementSnapshotRepositorySnapshot( snapshots );
        snapshots = visitor.replaceDistributionManagementSnapshotRepositorySnapshot( snapshots );
        deploymentRepository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:20,代码来源:DefaultModelProcessor.java

示例4: visitPluginRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitPluginRepository( ModelVisitor visitor, Repository repository )
{
    RepositoryPolicy releases = repository.getReleases();
    if ( releases != null )
    {
        visitor.visitPluginRepositoryRelease( releases );
        releases = visitor.replacePluginRepositoryRelease( releases );
        repository.setReleases( releases );
    }

    RepositoryPolicy snapshots = repository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitPluginRepositorySnapshot( snapshots );
        snapshots = visitor.replacePluginRepositorySnapshot( snapshots );
        repository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java

示例5: visitProfileDistributionManagementRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitProfileDistributionManagementRepository( ModelVisitor visitor,
                                                           DeploymentRepository deploymentRepository )
{
    RepositoryPolicy releases = deploymentRepository.getReleases();
    if ( releases != null )
    {
        visitor.visitProfileDistributionManagementRepositoryRelease( releases );
        releases = visitor.replaceProfileDistributionManagementRepositoryRelease( releases );
        deploymentRepository.setReleases( releases );
    }

    RepositoryPolicy snapshots = deploymentRepository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitProfileDistributionManagementRepositorySnapshot( snapshots );
        snapshots = visitor.replaceProfileDistributionManagementRepositorySnapshot( snapshots );
        deploymentRepository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:20,代码来源:DefaultModelProcessor.java

示例6: visitProfileDistributionManagementSnapshotRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitProfileDistributionManagementSnapshotRepository( ModelVisitor visitor,
                                                                   DeploymentRepository deploymentRepository )
{
    RepositoryPolicy releases = deploymentRepository.getReleases();
    if ( releases != null )
    {
        visitor.visitProfileDistributionManagementSnapshotRepositoryRelease( releases );
        releases = visitor.replaceProfileDistributionManagementSnapshotRepositoryRelease( releases );
        deploymentRepository.setReleases( releases );
    }

    RepositoryPolicy snapshots = deploymentRepository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitProfileDistributionManagementSnapshotRepositorySnapshot( snapshots );
        snapshots = visitor.replaceProfileDistributionManagementSnapshotRepositorySnapshot( snapshots );
        deploymentRepository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:20,代码来源:DefaultModelProcessor.java

示例7: visitProfilePluginRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitProfilePluginRepository( ModelVisitor visitor, Repository repository )
{
    RepositoryPolicy releases = repository.getReleases();
    if ( releases != null )
    {
        visitor.visitProfilePluginRepositoryRelease( releases );
        releases = visitor.replaceProfilePluginRepositoryRelease( releases );
        repository.setReleases( releases );
    }

    RepositoryPolicy snapshots = repository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitProfilePluginRepositorySnapshot( snapshots );
        snapshots = visitor.replaceProfilePluginRepositorySnapshot( snapshots );
        repository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java

示例8: visitProfileRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitProfileRepository( ModelVisitor visitor, Repository repository )
{
    RepositoryPolicy releases = repository.getReleases();
    if ( releases != null )
    {
        visitor.visitProfileRepositoryRelease( releases );
        releases = visitor.replaceProfileRepositoryRelease( releases );
        repository.setReleases( releases );
    }

    RepositoryPolicy snapshots = repository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitProfileRepositorySnapshot( snapshots );
        snapshots = visitor.replaceProfileRepositorySnapshot( snapshots );
        repository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java

示例9: visitRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void visitRepository( ModelVisitor visitor, Repository repository )
{
    RepositoryPolicy releases = repository.getReleases();
    if ( releases != null )
    {
        visitor.visitRepositoryRelease( releases );
        releases = visitor.replaceRepositoryRelease( releases );
        repository.setReleases( releases );
    }

    RepositoryPolicy snapshots = repository.getSnapshots();
    if ( snapshots != null )
    {
        visitor.visitRepositorySnapshot( snapshots );
        snapshots = visitor.replaceRepositorySnapshot( snapshots );
        repository.setSnapshots( snapshots );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:19,代码来源:DefaultModelProcessor.java

示例10: isCentralRepositoryFromSuperPom

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
/**
 * This method determines if the given {@link Repository} section is identical to what is defined from the super
 * POM.
 *
 * @param repo is the {@link Repository} section to check.
 * @return <code>true</code> if maven central default configuration, <code>false</code> otherwise.
 */
private static boolean isCentralRepositoryFromSuperPom( Repository repo )
{
    if ( repo != null )
    {
        if ( "central".equals( repo.getId() ) )
        {
            RepositoryPolicy snapshots = repo.getSnapshots();
            if ( snapshots != null && !snapshots.isEnabled() )
            {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:mojohaus,项目名称:flatten-maven-plugin,代码行数:23,代码来源:FlattenMojo.java

示例11: buildArtifactRepositoryPolicy

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
public ArtifactRepositoryPolicy buildArtifactRepositoryPolicy( RepositoryPolicy policy )
{
    boolean enabled = true;

    String updatePolicy = null;

    String checksumPolicy = null;

    if ( policy != null )
    {
        enabled = policy.isEnabled();

        if ( policy.getUpdatePolicy() != null )
        {
            updatePolicy = policy.getUpdatePolicy();
        }
        if ( policy.getChecksumPolicy() != null )
        {
            checksumPolicy = policy.getChecksumPolicy();
        }
    }

    return new ArtifactRepositoryPolicy( enabled, updatePolicy, checksumPolicy );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:25,代码来源:LegacyRepositorySystem.java

示例12: 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

示例13: 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

示例14: writeDeploymentRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的package包/类
private void writeDeploymentRepository(DeploymentRepository deploymentRepository, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (deploymentRepository.isUniqueVersion() != true) {
        writeValue(serializer, "uniqueVersion", String.valueOf(deploymentRepository.isUniqueVersion()), deploymentRepository);
    }
    if (deploymentRepository.getReleases() != null) {
        writeRepositoryPolicy((RepositoryPolicy) deploymentRepository.getReleases(), "releases", serializer);
    }
    if (deploymentRepository.getSnapshots() != null) {
        writeRepositoryPolicy((RepositoryPolicy) deploymentRepository.getSnapshots(), "snapshots", serializer);
    }
    if (deploymentRepository.getId() != null) {
        writeValue(serializer, "id", deploymentRepository.getId(), deploymentRepository);
    }
    if (deploymentRepository.getName() != null) {
        writeValue(serializer, "name", deploymentRepository.getName(), deploymentRepository);
    }
    if (deploymentRepository.getUrl() != null) {
        writeValue(serializer, "url", deploymentRepository.getUrl(), deploymentRepository);
    }
    if ((deploymentRepository.getLayout() != null) && !deploymentRepository.getLayout().equals("default")) {
        writeValue(serializer, "layout", deploymentRepository.getLayout(), deploymentRepository);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(deploymentRepository, "", start, b.length());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:LocationAwareMavenXpp3Writer.java

示例15: writeRepository

import org.apache.maven.model.RepositoryPolicy; //导入依赖的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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:LocationAwareMavenXpp3Writer.java


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