Examples of MavenConfigurationImpl


Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

        this.managedEndorsedLibs  = new Properties(bundleContext.getDataFile("endorsed.properties"));
        this.managedExtensionLibs  = new Properties(bundleContext.getDataFile("extension.properties"));
        this.managedEtcs = new Properties(bundleContext.getDataFile("etc.properties"));
        this.downloadExecutor = createDownloadExecutor();

        MavenConfigurationImpl config = new MavenConfigurationImpl(new PropertiesPropertyResolver(System.getProperties()), "org.ops4j.pax.url.mvn");
        config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
        manager = new DownloadManager(config, getDownloadExecutor());
        fabricService = new ServiceTracker<FabricService, FabricService>(systemBundleContext, FabricService.class, new ServiceTrackerCustomizer<FabricService, FabricService>() {
            @Override
            public FabricService addingService(ServiceReference<FabricService> reference) {
                FabricService service = systemBundleContext.getService(reference);
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

        updateStatus("analyzing", null);

        // Building configuration
        PropertiesPropertyResolver syspropsResolver = new PropertiesPropertyResolver(System.getProperties());
        DictionaryPropertyResolver propertyResolver = new DictionaryPropertyResolver(props, syspropsResolver);
        final MavenConfigurationImpl config = new MavenConfigurationImpl(propertyResolver, "org.ops4j.pax.url.mvn");
        config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
        manager = new DownloadManager(config, getDownloadExecutor());
        Map<String, String> properties = new HashMap<String, String>();
        for (Enumeration e = props.keys(); e.hasMoreElements();) {
            Object key = e.nextElement();
            Object val = props.get(key);
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

     */
    public static MavenConfiguration createMavenConfiguration(FabricService fabricService, Properties properties) {
        AgentUtils.addMavenProxies(properties, fabricService);
        PropertiesPropertyResolver propertiesPropertyResolver = new PropertiesPropertyResolver(System.getProperties());
        DictionaryPropertyResolver dictionaryPropertyResolver = new DictionaryPropertyResolver(properties, propertiesPropertyResolver);
        MavenConfigurationImpl config = new MavenConfigurationImpl(dictionaryPropertyResolver, "org.ops4j.pax.url.mvn");
        config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
        return config;
    }
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

        String home = System.getProperty("user.home");
        Properties properties = new Properties();
        properties.setProperty("mvn.localRepository", home+"/.m2/repository/@snapshots");
        properties.setProperty("mvn.repositories", "http://repo1.maven.org/maven2/,http://repository.jboss.org/nexus/content/groups/fs-public/,https://repo.fusesource.com/nexus/content/repositories/ea");
        PropertiesPropertyResolver propertyResolver = new PropertiesPropertyResolver(properties);
        MavenConfigurationImpl mavenConfiguration = new MavenConfigurationImpl(propertyResolver, "mvn");
        mavenConfiguration.setSettings(new MavenSettingsImpl(getClass().getResource("maven-default-settings.xml")));

        DownloadManager manager = new DownloadManager(mavenConfiguration, Executors.newFixedThreadPool(2));

        Map<URI, Repository> repositories = new HashMap<URI, Repository>();
        AgentUtils.addRepository(manager, repositories, URI.create("mvn:org.apache.karaf.assemblies.features/standard/" + System.getProperty("karaf-version") + "/xml/features"));
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

        }
        properties.setProperty("org.ops4j.pax.url.mvn.localRepository", systemRepoUri);
        properties.setProperty("org.ops4j.pax.url.mvn.repositories", remoteRepo);
        properties.setProperty("org.ops4j.pax.url.mvn.defaultRepositories", systemRepoUri);
        PropertiesPropertyResolver propertyResolver = new PropertiesPropertyResolver(properties);
        MavenConfigurationImpl mavenConfiguration = new MavenConfigurationImpl(propertyResolver, "org.ops4j.pax.url.mvn");
        mavenConfiguration.setSettings(new MavenSettingsImpl(mavenSettings.toURI().toURL()));
        return new DownloadManager(mavenConfiguration, Executors.newSingleThreadExecutor());
    }
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

    /**
     * Fetches archetype from the configured repositories
     * TODO: make this code available to hawt.io/JMX too
     */
    private File fetchArchetype(Archetype archetype) throws IOException {
        MavenConfigurationImpl config = new MavenConfigurationImpl(new PropertiesPropertyResolver(System.getProperties()), "org.ops4j.pax.url.mvn");
        config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
        DownloadManager dm = new DownloadManager(config, Executors.newSingleThreadExecutor());

        final CountDownLatch latch = new CountDownLatch(1);
        final DownloadFuture df = dm.download(String.format("mvn:%s/%s/%s", archetype.groupId, archetype.artifactId, archetype.version));
        df.addListener(new FutureListener<DownloadFuture>() {
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

        DownloadManager manager;
        final Map<String, Repository> repositories;
        Map<String, Feature[]> allFeatures = new HashMap<>();
        try {
            DictionaryPropertyResolver propertyResolver = new DictionaryPropertyResolver(properties);
            MavenConfigurationImpl config = new MavenConfigurationImpl(propertyResolver, "org.ops4j.pax.url.mvn");
            config.setSettings(new MavenSettingsImpl(config.getSettingsFileUrl(), config.useFallbackRepositories()));
            manager = new DownloadManager(config, executor);
            repositories = loadRepositories(manager, descriptors);
            for (String repoUri : repositories.keySet()) {
                Feature[] features = repositories.get(repoUri).getFeatures();
                // Ack features to inline configuration files urls
View Full Code Here

Examples of io.fabric8.agent.mvn.MavenConfigurationImpl

            Configuration configuration = configurationAdmin.get().getConfiguration("org.ops4j.pax.url.mvn");
            if (configuration != null) {
                Dictionary dictonary = configuration.getProperties();
                if (dictonary != null) {
                    DictionaryPropertyResolver resolver = new DictionaryPropertyResolver(dictonary);
                    mavenConfiguration = new MavenConfigurationImpl(resolver, "org.ops4j.pax.url.mvn");
                }
            }
        } catch (IOException e) {
            LOG.error("Error retrieving maven configuration", e);
        }
View Full Code Here

Examples of org.ops4j.pax.url.maven.commons.MavenConfigurationImpl

            if (configuration != null) {
                @SuppressWarnings("rawtypes")
        Dictionary dictonary = configuration.getProperties();
                if (dictonary != null) {
                    DictionaryPropertyResolver resolver = new DictionaryPropertyResolver(dictonary);
                    mavenConfiguration = new MavenConfigurationImpl(resolver, ServiceConstants.PID);
                }
            }
        } catch (IOException e) {
            logger.error("Error retrieving maven configuration", e);
        }
View Full Code Here

Examples of org.ops4j.pax.url.maven.commons.MavenConfigurationImpl

import java.net.URLStreamHandler;

public class Handler extends URLStreamHandler  {
    @Override
    protected URLConnection openConnection( final URL url ) throws IOException {
        final MavenConfigurationImpl config = new MavenConfigurationImpl(
                new PropertiesPropertyResolver( System.getProperties() ), "org.ops4j.pax.url.mvn");

        config.setSettings( new MavenSettingsImpl( config.getSettingsFileUrl(), config.useFallbackRepositories() ) );
        return new Connection( url, config );
    }
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.