Package org.apache.maven.artifact.deployer

Examples of org.apache.maven.artifact.deployer.ArtifactDeployer


        Artifact main = mainArtifact.toArtifact(handlerManager, artifactFactory, parent);
        if (!isPOM())
            main.addMetadata(new ProjectArtifactMetadata(main, pomArtifact.getFile(parent)));


        ArtifactDeployer deployer = embedder.lookup(ArtifactDeployer.class, uniqueVersion ? "default" : "maven2");
        logger.println(
                "[INFO] Deployment in " + deploymentRepository.getUrl() + " (id=" + deploymentRepository.getId() + ",uniqueVersion=" + deploymentRepository.isUniqueVersion()+")");

        // deploy the main artifact. This also deploys the POM
        logger.println(Messages.MavenArtifact_DeployingMainArtifact(main.getFile().getName()));
        deployer.deploy(main.getFile(), main, deploymentRepository, embedder.getLocalRepository());

        for (MavenArtifact aa : attachedArtifacts) {
            Artifact a = aa.toArtifact(handlerManager, artifactFactory, parent);
            logger.println(Messages.MavenArtifact_DeployingMainArtifact(a.getFile().getName()));
            deployer.deploy(a.getFile(), a, deploymentRepository, embedder.getLocalRepository());
        }
    }
View Full Code Here


        }

        ArtifactRepository deploymentRepository = getDeploymentRepository( pom, artifact );

        log( "Deploying to " + deploymentRepository.getUrl() );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( !isPomArtifact )
            {
                deployer.deploy( file, artifact, deploymentRepository, localRepo );
            }
            else
            {
                deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
            }

            // Deploy any attached artifacts
            if ( attachedArtifacts != null )
            {
                Iterator iter = pom.getAttachedArtifacts().iterator();

                while ( iter.hasNext() )
                {
                    Artifact attachedArtifact = (Artifact) iter.next();
                    deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
                }
            }
        }
        catch ( ArtifactDeploymentException e )
        {
View Full Code Here

        }

        ArtifactRepository deploymentRepository = getDeploymentRepository( pom, artifact );

        log( "Deploying to " + deploymentRepository.getUrl(), Project.MSG_INFO );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( file != null )
            {
                if ( !isPomArtifact )
                {
                    deployer.deploy( file, artifact, deploymentRepository, localRepo );
                }
                else
                {
                    deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
                }
            }

            // Deploy any attached artifacts
            if ( attachedArtifacts != null )
            {
                for ( Artifact attachedArtifact : pom.getAttachedArtifacts() )
                {
                    deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
                }
            }
        }
        catch ( ArtifactDeploymentException e )
        {
View Full Code Here

        }

        ArtifactRepository deploymentRepository = getDeploymentRepository( pom, artifact );

        log( "Deploying to " + deploymentRepository.getUrl() );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( !isPomArtifact )
            {
                if ( file == null )
                {
                    throw new BuildException( "You must specify a file to deploy to the repository." );
                }

                deployer.deploy( file, artifact, deploymentRepository, localRepo );
            }
            else
            {
                deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
            }

            // Deploy any attached artifacts
            if ( attachedArtifacts != null )
            {
                Iterator iter = pom.getAttachedArtifacts().iterator();

                while ( iter.hasNext() )
                {
                    Artifact attachedArtifact = (Artifact) iter.next();
                    deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
                }
            }
        }
        catch ( ArtifactDeploymentException e )
        {
View Full Code Here

            ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom.getFile() );
            artifact.addMetadata( metadata );
        }

        log( "Deploying to " + deploymentRepository.getUrl() );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( !isPomArtifact )
            {
                deployer.deploy( file, artifact, deploymentRepository, localRepo );
            }
            else
            {
                deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
            }
        }
        catch ( ArtifactDeploymentException e )
        {
            throw new BuildException(
                "Error deploying artifact '" + artifact.getDependencyConflictId() + "': " + e.getMessage(), e );
        }

        // Deploy any attached artifacts
        if (attachedArtifacts != null) {
            Iterator iter = attachedArtifacts.iterator();

            while (iter.hasNext()) {
                AttachedArtifact attached = (AttachedArtifact)iter.next();
                Artifact attachedArtifact = createArtifactFromAttached(attached, artifact);

                try {
                    deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
                }
                catch (ArtifactDeploymentException e) {
                    throw new BuildException(
                        "Error deploying attached artifact '" + attachedArtifact.getDependencyConflictId() + "': " + e.getMessage(), e );
                }
View Full Code Here

            ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom.getFile() );
            artifact.addMetadata( metadata );
        }

        log( "Deploying to " + deploymentRepository.getUrl() );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( !isPomArtifact )
            {
                deployer.deploy( file, artifact, deploymentRepository, localRepo );
            }
            else
            {
                deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
            }
        }
        catch ( ArtifactDeploymentException e )
        {
            throw new BuildException(
View Full Code Here

        }

        ArtifactRepository deploymentRepository = getDeploymentRepository( pom, artifact );

        log( "Deploying to " + deploymentRepository.getUrl(), Project.MSG_INFO );
        ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
        try
        {
            if ( file != null )
            {
                if ( !isPomArtifact )
                {
                    deployer.deploy( file, artifact, deploymentRepository, localRepo );
                }
                else
                {
                    deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
                }
            }

            // Deploy any attached artifacts
            if ( attachedArtifacts != null )
            {
                Iterator iter = pom.getAttachedArtifacts().iterator();

                while ( iter.hasNext() )
                {
                    Artifact attachedArtifact = (Artifact) iter.next();
                    deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
                }
            }
        }
        catch ( ArtifactDeploymentException e )
        {
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.deployer.ArtifactDeployer

Copyright © 2018 www.massapicom. 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.