Package io.fabric8.agent.mvn

Examples of io.fabric8.agent.mvn.Parser


        root.getConnection().run(new IJMXRunnable() {
         
          @Override
          public void run(MBeanServerConnection connection) throws JMXException {
            // TODO REPLACE WITH BETTER JmxTemplateImpl...
            BrokerFacade facade = new RemoteBrokerFacade(connection);
            BrokerNode broker = new BrokerNode(root, facade, "Broker");
            root.addChild(broker);
          }
        });
      } catch (CoreException e) {
View Full Code Here


    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.activemq")) {
          BrokerFacade facade = new JmxTemplateBrokerFacade(new JmxPluginJmxTemplate(r.getConnection()));
          String brokerName = null;
          try {
            brokerName = facade.getBrokerName();
          } catch (Exception e) {
            ActiveMQJMXPlugin.getLogger().warning("Could not find Broker name: " + e, e);
          }
          if (brokerName == null) {
            brokerName = "Broker";
View Full Code Here

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.activemq")) {
          BrokerFacade facade = new JmxTemplateBrokerFacade(new JmxPluginJmxTemplate(r.getConnection()));
          String brokerName = null;
          try {
            brokerName = facade.getBrokerName();
          } catch (Exception e) {
            ActiveMQJMXPlugin.getLogger().warning("Could not find Broker name: " + e, e);
          }
          if (brokerName == null) {
            brokerName = "Broker";
View Full Code Here

        root.getConnection().run(new IJMXRunnable() {
         
          @Override
          public void run(MBeanServerConnection connection) throws JMXException {
            // TODO REPLACE WITH BETTER JmxTemplateImpl...
            BrokerFacade facade = new RemoteBrokerFacade(connection);
            BrokerNode broker = new BrokerNode(root, facade, "Broker");
            root.addChild(broker);
          }
        });
      } catch (CoreException e) {
View Full Code Here

        }
    }

    protected static void addMavenDependencies(Map<String, Parser> artifacts, DependencyDTO dependency) throws MalformedURLException {
        String url = dependency.toBundleUrlWithType();
        Parser parser = Parser.parsePathWithSchemePrefix(url);
        String scope = dependency.getScope();
        if (!artifacts.containsKey(url) && !artifacts.containsValue(parser) && !(Objects.equal("test", scope))) {
            LOGGER.debug("Adding url: " + url + " parser: " + parser);
            artifacts.put(url, parser);
        }
View Full Code Here

                Map<String, String> locationToContextPathMap = new HashMap<String, String>();
                // lets map the the locations to context paths

                Set<String> locations = javaArtifacts.keySet();
                for (String location : locations) {
                    Parser parser = null;
                    try {
                        parser = Parser.parsePathWithSchemePrefix(location);
                    } catch (MalformedURLException e) {
                        // ignore
                    }
                    if (parser != null) {
                        String key = parser.getGroup() + "/" + parser.getArtifact();
                        String value = contextPathConfiguration.get(key);
                        if (value != null) {
                            locationToContextPathMap.put(location, value);
                        }
                    }
View Full Code Here

                    ProfileService profileService = fabricService.adapt(ProfileService.class);
                    Profile overlay = profileService.getOverlayProfile(profile);
          location = VersionPropertyPointerResolver.replaceVersions(fabricService, overlay.getConfigurations(), location);
                }
                if (location.startsWith("mvn:") || location.contains(":mvn:")) {
                    Parser parser = Parser.parsePathWithSchemePrefix(location);
                    artifacts.put(location, parser);
                } else {
                    if (nonMavenLocationCallback != null) {
                        nonMavenLocationCallback.call(location);
                    }
View Full Code Here

        this.inlined = inlined;
        this.configuration = configuration;
    }

    protected File download() throws Exception {
        Parser parser = Parser.parsePathWithSchemePrefix(url);
        Set<DownloadableArtifact> downloadables;
        if (!parser.getVersion().contains("SNAPSHOT")) {
            downloadables = doCollectPossibleDownloads(parser, Arrays.asList(cache, system, configuration.getLocalRepository()));
            for (DownloadableArtifact artifact : downloadables) {
                URL url = artifact.getArtifactURL();
                File file = new File(url.getFile());
                if (file.exists()) {
                    return file;
                }
            }
        }
        downloadables = collectPossibleDownloads(parser);
        if (LOG.isTraceEnabled()) {
            LOG.trace("Possible download locations for [" + url + "]");
            for (DownloadableArtifact artifact : downloadables) {
                LOG.trace("  " + artifact);
            }
        }
        for (DownloadableArtifact artifact : downloadables) {
            LOG.trace("Downloading [" + artifact + "]");
            try {
                configuration.enableProxy(artifact.getArtifactURL());
                String repository = cache.getFile().getAbsolutePath();
                if (!repository.endsWith(File.separator)) {
                    repository = repository + File.separator;
                }
                InputStream is = artifact.getInputStream();
                File file = new File(repository + parser.getArtifactPath());
                file.getParentFile().mkdirs();
                if (!file.getParentFile().isDirectory()) {
                    throw new IOException("Unable to create directory " + file.getParentFile().toString());
                }
                File tmp = File.createTempFile("fabric-agent-", null, file.getParentFile());
View Full Code Here

                String fileName = file.getName();
                String mvnCoords = getMavenCoords(name);

                File destFile;
                if (mvnCoords != null) {
                    Parser parser = new Parser(mvnCoords);
                    destFile = new File(target, parser.getArtifactPath());
                } else {
                    destFile = new File(target, fileName);
                }
                if (force || !destFile.exists()) {
                    LOG.info("Copying file: " + file + " to: " + destFile.getCanonicalPath());
View Full Code Here

        for (Map.Entry<String, Parser> entry : entries) {
            String uri = entry.getKey();
            if (uri.startsWith("fab:")) {
                uri = uri.substring(4);
            }
            Parser parser = entry.getValue();
            File file = files.get(uri);
            if (file == null) {
                LOG.warn("Could not find file for " + uri + " in files map when has parser: " + parser);
                continue;
            }
            String fileName = parser.getArtifactPath();
            File outputDir;
            if (fileName.toLowerCase().endsWith(".jar")) {
                outputDir = uploadLibDir;
                libFileCount++;
            }
            else {
                outputDir = uploadDeployDir;
                deployFileCount++;
            }
            outputDir.mkdirs();
            File outFile = new File(outputDir, fileName);
            outFile.getParentFile().mkdirs();
            Files.copy(file, outFile);
        }

        // lets make sure there's all the feature files too
        Set<String> processedFeatureXmls = new HashSet<>();
        for (Profile profile : profileList) {
            List<String> repositories = profile.getRepositories();
            for (String repository : repositories) {
                if (processedFeatureXmls.add(repository)) {
                    if (repository.contains("$")) {
                        Map<String, Map<String, String>> configurations = Profiles.getOverlayConfigurations(fabric, profileList);
                        repository = VersionPropertyPointerResolver.replaceVersions(fabric, configurations, repository);
                    }
                    Parser parser = null;
                    URL url = null;
                    try {
                        parser = Parser.parsePathWithSchemePrefix(repository);
                    } catch (MalformedURLException e) {
                        LOG.warn("Could not parse maven coords in features repository: " + repository + ". " + e, e);
                    }
                    try {
                        url = new URL(repository);
                    } catch (MalformedURLException e) {
                        LOG.warn("Could not parse URL for feature repository: " + repository + ". " + e, e);
                    }
                    if (parser != null && url != null) {
                        InputStream inputStream = null;
                        try {
                            inputStream = url.openStream();
                            if (inputStream == null) {
                                LOG.warn("Could not load URL for feature repository: " + repository);
                                continue;
                            }
                        } catch (IOException e) {
                            LOG.warn("Could not load URL for feature repository: " + repository + ". " + e, e);
                            continue;
                        }
                        String fileName = parser.getArtifactPath();
                        uploadLibDir.mkdirs();
                        File outFile = new File(uploadLibDir, fileName);
                        outFile.getParentFile().mkdirs();
                        try {
                            Files.copy(inputStream, new FileOutputStream(outFile));
View Full Code Here

TOP

Related Classes of io.fabric8.agent.mvn.Parser

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.