Package org.eclipse.aether.installation

Examples of org.eclipse.aether.installation.InstallRequest


                                                    gav.getVersion() );
        pomXMLArtifact = pomXMLArtifact.setFile( pomXMLFile );

        try {
            //Install into local repository
            final InstallRequest installRequest = new InstallRequest();
            installRequest
                    .addArtifact( pomXMLArtifact );

            Aether.getAether().getSystem().install( Aether.getAether().getSession(),
                                                    installRequest );
        } catch ( InstallationException e ) {
View Full Code Here


                                                   "pom" );
        pomXMLArtifact = pomXMLArtifact.setFile( pomXMLFile );

        try {
            //Install into local repository
            final InstallRequest installRequest = new InstallRequest();
            installRequest
                    .addArtifact( jarArtifact )
                    .addArtifact( pomXMLArtifact );

            Aether.getAether().getSystem().install( Aether.getAether().getSession(),
                                                    installRequest );
View Full Code Here

        throws ArtifactInstallationException
    {
        RepositorySystemSession session =
            LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem );

        InstallRequest request = new InstallRequest();

        request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) );

        org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
        mainArtifact = mainArtifact.setFile( source );
        request.addArtifact( mainArtifact );

        for ( ArtifactMetadata metadata : artifact.getMetadataList() )
        {
            if ( metadata instanceof ProjectArtifactMetadata )
            {
                org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
                pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
                request.addArtifact( pomArtifact );
            }
            else if ( metadata instanceof SnapshotArtifactRepositoryMetadata
                || metadata instanceof ArtifactRepositoryMetadata )
            {
                // eaten, handled by repo system
            }
            else
            {
                request.addMetadata( new MetadataBridge( metadata ) );
            }
        }

        try
        {
View Full Code Here

                                                   "pom" );
        pomXMLArtifact = pomXMLArtifact.setFile( pomXMLFile );

        try {
            //Install into local repository
            final InstallRequest installRequest = new InstallRequest();
            installRequest
                    .addArtifact( jarArtifact )
                    .addArtifact( pomXMLArtifact );

            Aether.getAether().getSystem().install( Aether.getAether().getSession(),
                                                    installRequest );
View Full Code Here

        Artifact artifact = new DefaultArtifact(coordinate);
       
        File dstFile = new File( lrm.getRepository().getBasedir(), lrm.getPathForLocalArtifact( artifact ) );
        if (!dstFile.exists() ){
            artifact = artifact.setFile(new File(file));
            InstallRequest request = new InstallRequest();
            request.addArtifact(artifact);
            installer.install(getSession(), request);
        }
   }
View Full Code Here

     * @throws IllegalArgumentException if the groupId, artifactId, version or pomFile is null.
     */
    public void install(final String groupId, final String artifactId, final String version, final String classifier, final File pomFile, final File artifactFile)
        throws InstallationException, SettingsBuildingException {

        InstallRequest installRequest = new InstallRequest();
        if(artifactFile!=null) {
            String name = artifactFile.getName();
            String type = name.substring(artifactFile.getName().lastIndexOf(".")+1, name.length());
            Artifact jarArtifact = new DefaultArtifact(groupId, artifactId, classifier, type, version);
            jarArtifact = jarArtifact.setFile(artifactFile);
            Artifact pomArtifact = new SubArtifact(jarArtifact, classifier, "pom");
            pomArtifact = pomArtifact.setFile(pomFile);
            installRequest = installRequest.addArtifact(jarArtifact).addArtifact(pomArtifact);
        } else {
            Artifact pomArtifact = new DefaultArtifact(groupId, artifactId, classifier, "pom", version);
            pomArtifact = pomArtifact.setFile(pomFile);
            installRequest = installRequest.addArtifact(pomArtifact);
        }
        repositorySystem.install(getRepositorySystemSession(), installRequest);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.aether.installation.InstallRequest

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.