Examples of DistributionManagement


Examples of org.apache.maven.model.DistributionManagement

    }

    private Relocation getRelocation( Model model )
    {
        Relocation relocation = null;
        DistributionManagement distMngt = model.getDistributionManagement();
        if ( distMngt != null )
        {
            relocation = distMngt.getRelocation();
        }
        return relocation;
    }
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

    }

    protected void mergeModelBase_DistributionManagement( ModelBase target, ModelBase source, boolean sourceDominant,
                                                          Map<Object, Object> context )
    {
        DistributionManagement src = source.getDistributionManagement();
        if ( src != null )
        {
            DistributionManagement tgt = target.getDistributionManagement();
            if ( tgt == null )
            {
                tgt = new DistributionManagement();
                target.setDistributionManagement( tgt );
            }
            mergeDistributionManagement( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

            for ( Repository repository : model.getPluginRepositories() )
            {
                validateRepository( problems, repository, "pluginRepositories.pluginRepository", request );
            }

            DistributionManagement distMgmt = model.getDistributionManagement();
            if ( distMgmt != null )
            {
                if ( distMgmt.getStatus() != null )
                {
                    addViolation( problems, Severity.ERROR, "distributionManagement.status", null,
                                  "must not be specified.", distMgmt );
                }

                validateRepository( problems, distMgmt.getRepository(), "distributionManagement.repository", request );
                validateRepository( problems, distMgmt.getSnapshotRepository(),
                                    "distributionManagement.snapshotRepository", request );
            }
        }
    }
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

        }

        //Deploy into remote repository defined in <distributionManagement>
        try {
            final Model model = new MavenXpp3Reader().read( new StringReader( pomXML ) );
            final DistributionManagement distributionManagement = model.getDistributionManagement();

            if ( distributionManagement != null ) {

                final boolean isSnapshot = pomXMLArtifact.isSnapshot();
                DeploymentRepository remoteRepository = null;
                if ( isSnapshot ) {
                    remoteRepository = distributionManagement.getSnapshotRepository();
                } else {
                    remoteRepository = distributionManagement.getRepository();
                }

                //If the user has configured a distribution management module in the pom then we will attempt to deploy there.
                //If credentials are required those credentials must be provisioned in the user's settings.xml file
                if ( remoteRepository != null ) {
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

    }

    private MavenProject getMavenProjectStub( boolean https )
    {
        final DistributionManagement distributionManagement = new DistributionManagement();
        DeploymentRepository repository = new DeploymentRepository();
        repository.setId( "localhost" );
        repository.setUrl( ( https ? "https" : "http" ) + "://localhost:" + port );
        distributionManagement.setRepository( repository );
        distributionManagement.setSnapshotRepository( repository );
        return new MavenProjectStub()
        {
            @Override
            public DistributionManagement getDistributionManagement()
            {
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

            }
            endTable();
            endSection();

            // download section
            DistributionManagement distributionManagement = project.getDistributionManagement();
            if ( distributionManagement != null )
            {
                if ( StringUtils.isNotEmpty( distributionManagement.getDownloadUrl() ) )
                {
                    startSection( getI18nString( "download" ) );
                    link( distributionManagement.getDownloadUrl(), distributionManagement.getDownloadUrl() );
                    endSection();
                }
            }

            endSection();
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

    public void testDistributionManagementInheritance()
    {
        Model parent = makeBaseModel( "parent" );
        Model child = makeBaseModel( "child" );

        DistributionManagement distributionManagement = new DistributionManagement();
        distributionManagement.setDownloadUrl( "downloadUrl" );
        distributionManagement.setRelocation( new Relocation() );
        distributionManagement.setStatus( "deployed" );

        DeploymentRepository repository = new DeploymentRepository();
        repository.setId( "apache.releases" );
        repository.setUrl( "scp://minotaur.apache.org/www/www.apache.org/dist/java-repository" );
        repository.setName( "name" );
        repository.setLayout( "legacy" );
        distributionManagement.setRepository( repository );

        DeploymentRepository snapshotRepository = new DeploymentRepository();
        snapshotRepository.setId( "apache.snapshots" );
        snapshotRepository.setUrl( "scp://minotaur.apache.org/www/cvs.apache.org/repository" );
        snapshotRepository.setName( "name" );
        snapshotRepository.setLayout( "legacy" );
        snapshotRepository.setUniqueVersion( false );
        distributionManagement.setSnapshotRepository( snapshotRepository );

        Site site = new Site();
        site.setId( "apache.website" );
        site.setUrl( "scp://minotaur.apache.org/www/maven.apache.org/" );
        site.setName( "name3" );
        distributionManagement.setSite( site );

        parent.setDistributionManagement( distributionManagement );

        assembler.assembleModelInheritance( child, parent );

        DistributionManagement childDistMgmt = child.getDistributionManagement();
        assertNotNull( "Check distMgmt inherited", childDistMgmt );
        assertNull( "Check status NOT inherited", childDistMgmt.getStatus() );
        assertNull( "Check relocation NOT inherited", childDistMgmt.getRelocation() );
        assertEquals( "Check downloadUrl inherited", distributionManagement.getDownloadUrl(),
                      childDistMgmt.getDownloadUrl() );

        Site childSite = childDistMgmt.getSite();
        assertNotNull( "Check site inherited", childSite );
        assertEquals( "Check id matches", site.getId(), childSite.getId() );
        assertEquals( "Check name matches", site.getName(), childSite.getName() );
        assertEquals( "Check url matches with appended path", site.getUrl() + "child", childSite.getUrl() );

        assertRepositoryBase( childDistMgmt.getRepository(), repository );
        assertRepositoryBase( childDistMgmt.getSnapshotRepository(), snapshotRepository );
        assertEquals( "Check uniqueVersion is inherited", snapshotRepository.isUniqueVersion(),
                      childDistMgmt.getSnapshotRepository().isUniqueVersion() );
    }
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

        if ( src == null )
        {
            return null;
        }
       
        DistributionManagement result = new DistributionManagement();
       
        result.setDownloadUrl( src.getDownloadUrl() );
        result.setRelocation( cloneRelocation( src.getRelocation() ) );
        result.setRepository( cloneDeploymentRepository( src.getRepository() ) );
        result.setSite( cloneSite( src.getSite() ) );
        result.setSnapshotRepository( cloneDeploymentRepository( src.getSnapshotRepository() ) );
        result.setStatus( src.getStatus() );
       
        return result;
    }
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

                if ( project != null )
                {
                    Relocation relocation = null;

                    DistributionManagement distMgmt = project.getDistributionManagement();
                    if ( distMgmt != null )
                    {
                        relocation = distMgmt.getRelocation();

                        artifact.setDownloadUrl( distMgmt.getDownloadUrl() );
                        pomArtifact.setDownloadUrl( distMgmt.getDownloadUrl() );
                    }

                    if ( relocation != null )
                    {
                        if ( relocation.getGroupId() != null )
View Full Code Here

Examples of org.apache.maven.model.DistributionManagement

            String downloadUrl = null;

            ArtifactStatus status = ArtifactStatus.NONE;

            DistributionManagement distributionManagement = model.getDistributionManagement();

            if ( distributionManagement != null )
            {
                downloadUrl = distributionManagement.getDownloadUrl();

                status = ArtifactStatus.valueOf( distributionManagement.getStatus() );
            }

            checkStatusAndUpdate( projectArtifact, status, file, remoteArtifactRepositories, localRepository );

            // TODO: this is gross. Would like to give it the whole model, but maven-artifact shouldn't depend on that
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.