Package org.apache.maven.artifact.installer

Examples of org.apache.maven.artifact.installer.DefaultArtifactInstaller


            MavenSession session = reflectiveCreateMavenSession(container, mvn, request);
            LegacySupport legacy = container.lookup(LegacySupport.class);
            legacy.setSession(session);

            // then lookup the DefaultArtifactInstaller
            DefaultArtifactInstaller dai = (DefaultArtifactInstaller) container.lookup(ArtifactInstaller.class);

            final Set<Entry<String, InputStream>> entries = origins.entrySet();
            for (Iterator<Entry<String, InputStream>> it = entries.iterator(); it.hasNext();) {
                final Entry<String, InputStream> entry = it.next();
                final String fileExtension = entry.getKey();
                final InputStream in = entry.getValue();
                File tmpFile = File.createTempFile("slingClipseTmp", fileExtension);
                FileOutputStream fos = new FileOutputStream(tmpFile);

                try {
                    IOUtils.copy(in, fos);
                    Artifact jarArtifact = new DefaultArtifact(groupId, artifactId, version, "", fileExtension, "",
                            new DefaultArtifactHandler());
                    dai.install(tmpFile, jarArtifact, maven.getLocalRepository());
                } finally {
                    IOUtils.closeQuietly(in);
                    IOUtils.closeQuietly(fos);
                    FileUtils.deleteQuietly(tmpFile);
                }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.installer.DefaultArtifactInstaller

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.