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


Java DistributionManagement类代码示例

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


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

示例1: updateDistributionManagement

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
/**
 * Method updateDistributionManagement
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateDistributionManagement( DistributionManagement value, String xmlTag, Counter counter,
                                             Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        updateDeploymentRepository( value.getRepository(), "repository", innerCount, root );
        updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root );
        updateSite( value.getSite(), "site", innerCount, root );
        findAndReplaceSimpleElement( innerCount, root, "downloadUrl", value.getDownloadUrl(), null );
        updateRelocation( value.getRelocation(), "relocation", innerCount, root );
        findAndReplaceSimpleElement( innerCount, root, "status", value.getStatus(), null );
    }
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:25,代码来源:MavenJDOMWriter.java

示例2: 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);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-maven-plugin,代码行数:18,代码来源:MavenModelUtils.java

示例3: addProfiles

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
public static void addProfiles(Model pomModel) {
    Profile profile = new Profile();
    profile.setId("milestone");
    DistributionManagement milestoneDistManagement = new DistributionManagement();

    DeploymentRepository milestoneRepo = new DeploymentRepository();
    milestoneRepo.setId("repo.spring.io");
    milestoneRepo.setName("Spring Milestone Repository");
    milestoneRepo.setUrl("https://repo.spring.io/libs-milestone-local");
    milestoneDistManagement.setRepository(milestoneRepo);
    profile.setDistributionManagement(milestoneDistManagement);
    List<Profile> profiles = new ArrayList<>();
    profiles.add(profile);

    profiles.add(centralProfile());

    pomModel.setProfiles(profiles);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-maven-plugin,代码行数:19,代码来源:MavenModelUtils.java

示例4: getRelocation

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private Relocation getRelocation(org.netbeans.modules.maven.model.pom.Dependency d) {
    ProjectBuildingRequest dpbr = EmbedderFactory.getProjectEmbedder().createMavenExecutionRequest().getProjectBuildingRequest();
    dpbr.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
    dpbr.setProcessPlugins(false);
    dpbr.setResolveDependencies(false);
    ArrayList<ArtifactRepository> remoteRepos = new ArrayList<>();
    dpbr.setRemoteRepositories(remoteRepos);
    String groupId = d.getGroupId();
    String artifactId = d.getArtifactId();
    String version = d.getVersion();
    if(groupId != null && !"".equals(groupId.trim()) &&
       artifactId != null && !"".equals(artifactId.trim()) &&
       version != null && !"".equals(version.trim())) 
    {           
        MavenEmbedder embedder = EmbedderFactory.getProjectEmbedder();
        Artifact a = embedder.createProjectArtifact(groupId, artifactId, version);
        try {
            ProjectBuildingResult r = embedder.buildProject(a, dpbr);
            DistributionManagement dm = r.getProject().getDistributionManagement();
            return dm != null ? dm.getRelocation() : null;
        } catch (ProjectBuildingException ex) {
            // just log and hope for the best ...
            Logger.getLogger(DependencyNode.class.getName()).log(Level.INFO, version, ex);                
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:DependencyNode.java

示例5: writeDistributionManagement

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private void writeDistributionManagement(DistributionManagement distributionManagement, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();

    if (distributionManagement.getRepository() != null) {
        writeDeploymentRepository((DeploymentRepository) distributionManagement.getRepository(), "repository", serializer);
    }
    if (distributionManagement.getSnapshotRepository() != null) {
        writeDeploymentRepository((DeploymentRepository) distributionManagement.getSnapshotRepository(), "snapshotRepository", serializer);
    }
    if (distributionManagement.getSite() != null) {
        writeSite((Site) distributionManagement.getSite(), "site", serializer);
    }
    if (distributionManagement.getDownloadUrl() != null) {
        writeValue(serializer, "downloadUrl", distributionManagement.getDownloadUrl(), distributionManagement);
    }
    if (distributionManagement.getRelocation() != null) {
        writeRelocation((Relocation) distributionManagement.getRelocation(), "relocation", serializer);
    }
    if (distributionManagement.getStatus() != null) {
        writeValue(serializer, "status", distributionManagement.getStatus(), distributionManagement);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(distributionManagement, "", start, b.length());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:LocationAwareMavenXpp3Writer.java

示例6: writeRelocationPom

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId,
                                 String newArtifactId, String newVersion, String message,
                                 ArtifactRepository repository, FileTransaction transaction )
    throws IOException
{
    Model pom = new Model();
    pom.setGroupId( groupId );
    pom.setArtifactId( artifactId );
    pom.setVersion( version );

    DistributionManagement dMngt = new DistributionManagement();

    Relocation relocation = new Relocation();
    relocation.setGroupId( newGroupId );
    relocation.setArtifactId( newArtifactId );
    relocation.setVersion( newVersion );
    if ( message != null && message.length() > 0 )
    {
        relocation.setMessage( message );
    }

    dMngt.setRelocation( relocation );

    pom.setDistributionManagement( dMngt );

    Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$
    File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) );

    StringWriter strWriter = new StringWriter();
    MavenXpp3Writer pomWriter = new MavenXpp3Writer();
    pomWriter.write( strWriter, pom );

    transaction.createFile( strWriter.toString(), pomFile, digesters );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:35,代码来源:LegacyToDefaultConverter.java

示例7: 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 );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:37,代码来源:DefaultModelProcessor.java

示例8: 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 );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:38,代码来源:DefaultModelProcessor.java

示例9: writeRelocationPom

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId,
                                 String newArtifactId, String newVersion, String message,
                                 ArtifactRepository repository, FileTransaction transaction )
    throws IOException
{
    Model pom = new Model();
    pom.setGroupId( groupId );
    pom.setArtifactId( artifactId );
    pom.setVersion( version );

    DistributionManagement dMngt = new DistributionManagement();

    Relocation relocation = new Relocation();
    relocation.setGroupId( newGroupId );
    relocation.setArtifactId( newArtifactId );
    relocation.setVersion( newVersion );
    if ( message != null && message.length() > 0 )
    {
        relocation.setMessage( message );
    }

    dMngt.setRelocation( relocation );

    pom.setDistributionManagement( dMngt );

    Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$
    Path pomFile = Paths.get( repository.getBasedir(), repository.pathOf( artifact ) );

    StringWriter strWriter = new StringWriter();
    MavenXpp3Writer pomWriter = new MavenXpp3Writer();
    pomWriter.write( strWriter, pom );

    transaction.createFile( strWriter.toString(), pomFile, digesters );
}
 
开发者ID:apache,项目名称:archiva,代码行数:35,代码来源:LegacyToDefaultConverter.java

示例10: getReleaseRepo

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private ArtifactRepository getReleaseRepo() {
	DistributionManagement distributionManagement = project.getDistributionManagement();
       if ( distributionManagement != null && distributionManagement.getRepository() != null ) {        	
       	try {
       		ArtifactRepository repo = repositorySystem.buildArtifactRepository(distributionManagement.getRepository());

               repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(), Arrays.asList( repo ) );
               repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
                                                      Arrays.asList( repo ) );
               return repo;
       	} catch (InvalidRepositoryException e) {}
       }
       return null;
}
 
开发者ID:johnoliver,项目名称:git-rollback-maven-plugin,代码行数:15,代码来源:GitReleaseRollback.java

示例11: getRelocation

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
private Relocation getRelocation( Model model )
{
    Relocation relocation = null;
    DistributionManagement distMngt = model.getDistributionManagement();
    if ( distMngt != null )
    {
        relocation = distMngt.getRelocation();
    }
    return relocation;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:11,代码来源:DefaultArtifactDescriptorReader.java

示例12: mergeDistributionManagement

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
protected void mergeDistributionManagement( DistributionManagement target, DistributionManagement source,
                                            boolean sourceDominant, Map<Object, Object> context )
{
    mergeDistributionManagement_Repository( target, source, sourceDominant, context );
    mergeDistributionManagement_SnapshotRepository( target, source, sourceDominant, context );
    mergeDistributionManagement_Site( target, source, sourceDominant, context );
    mergeDistributionManagement_Status( target, source, sourceDominant, context );
    mergeDistributionManagement_DownloadUrl( target, source, sourceDominant, context );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:10,代码来源:ModelMerger.java

示例13: mergeDistributionManagement_Status

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

示例14: mergeDistributionManagement_DownloadUrl

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

示例15: normalize

import org.apache.maven.model.DistributionManagement; //导入依赖的package包/类
public void normalize( Model model, ModelBuildingRequest request )
{
    if ( model == null )
    {
        return;
    }

    model.setUrl( normalize( model.getUrl() ) );

    Scm scm = model.getScm();
    if ( scm != null )
    {
        scm.setUrl( normalize( scm.getUrl() ) );
        scm.setConnection( normalize( scm.getConnection() ) );
        scm.setDeveloperConnection( normalize( scm.getDeveloperConnection() ) );
    }

    DistributionManagement dist = model.getDistributionManagement();
    if ( dist != null )
    {
        Site site = dist.getSite();
        if ( site != null )
        {
            site.setUrl( normalize( site.getUrl() ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:28,代码来源:DefaultModelUrlNormalizer.java


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