Package org.apache.ivy.plugins.repository.url

Examples of org.apache.ivy.plugins.repository.url.URLResource


        assertEquals(extraAtt, dds[0].getAllDependencyArtifacts()[0].getExtraAttributes());

        // now we verify the conversion to an Ivy file
        PomModuleDescriptorParser.getInstance().toIvyFile(
            getClass().getResource("test-dependencies-with-classifier.pom").openStream(),
            new URLResource(getClass().getResource("test-dependencies-with-classifier.pom")),
            dest, md);

        assertTrue(dest.exists());

        // the converted Ivy file should be parsable with validate=true
View Full Code Here


        ParserSettings pSettings = new CacheParserSettings(settings, paths);

        URL ivyFileURL = ivyFile.toURI().toURL();
        ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance().getParser(
                new URLResource(ivyFileURL));
        return parser.parseDescriptor(pSettings, ivyFileURL, false);
    }
View Full Code Here

        IvyContext.pushNewContext().setIvy(getEasyAntIvyInstance());
        EasyAntModuleDescriptorParser parser = getEasyAntModuleDescriptorParser(buildModule);
        log("Loading EasyAnt module descriptor :" + parser.getClass().getName(), Project.MSG_DEBUG);

        try {
            parser.parseDescriptor(getEasyAntIvyInstance().getSettings(), buildModule.toURI().toURL(), new URLResource(
                    buildModule.toURI().toURL()), true);
            EasyAntModuleDescriptor md = parser.getEasyAntModuleDescriptor();
            ModuleRevisionId currentModule = md.getIvyModuleDescriptor().getModuleRevisionId();

            String buildConfigurations = null;
View Full Code Here

    protected EasyAntModuleDescriptorParser getEasyAntModuleDescriptorParser(File file) throws BuildException {
        ModuleDescriptorParser mdp = null;
        EasyAntModuleDescriptorParser parser = null;
        try {
            mdp = ModuleDescriptorParserRegistry.getInstance().getParser(new URLResource(file.toURI().toURL()));
        } catch (MalformedURLException e) {
            throw new BuildException("Impossible to find a parser for " + file.getName());
        }
        // If valid easyant parser is defined use it
        if (mdp != null && mdp.getClass().isInstance(EasyAntModuleDescriptorParser.class)) {
View Full Code Here

            File ivyFile = getIvyFileInCache(mrid);
            if (ivyFile.exists()) {
                // found in cache !
                try {
                    ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance().getParser(
                            new URLResource(ivyFile.toURI().toURL()));
                    ModuleDescriptor depMD = getMdFromCache(parser, options, ivyFile);
                    String resolverName = getSavedResolverName(depMD);
                    String artResolverName = getSavedArtResolverName(depMD);
                    DependencyResolver resolver = settings.getResolver(resolverName);
                    if (resolver == null) {
View Full Code Here

        try {
            url = file.toURI().toURL();
        } catch (MalformedURLException e) {
            throw new BuildException("[easyant bug] a file has not a proper url", e);
        }
        URLResource res = new URLResource(url);
        ModuleDescriptorParser mdparser = ModuleDescriptorParserRegistry.getInstance().getParser(res);
        ModuleDescriptor md;
        ivy.pushContext();
        try {
            md = mdparser.parseDescriptor(ivy.getSettings(), url, true);
View Full Code Here

        if (confs == null || (confs.length == 1 && "*".equals(confs[0]))) {
            try {
                File ivyFile = getCache().getResolvedIvyFileInCache(mrid);
                Message.verbose("no explicit confs given for retrieve, using ivy file: " + ivyFile);
                URL ivySource = ivyFile.toURI().toURL();
                URLResource res = new URLResource(ivySource);
                ModuleDescriptorParser parser = ModuleDescriptorParserRegistry.getInstance()
                        .getParser(res);
                Message.debug("using " + parser + " to parse " + ivyFile);
                ModuleDescriptor md = parser.parseDescriptor(settings, ivySource, false);
                confs = md.getConfigurationsNames();
View Full Code Here

                    + moduleDescriptor.getAbsolutePath());
        }
        IvyContext.pushNewContext().setIvy(ivyInstance);
        // First we need to parse the specified file to retrieve all the easyant
        // stuff
        parser.parseDescriptor(ivyInstance.getSettings(), moduleDescriptor.toURI().toURL(), new URLResource(
                moduleDescriptor.toURI().toURL()), true);
        EasyAntModuleDescriptor md = parser.getEasyAntModuleDescriptor();
        IvyContext.popContext();
        return md;
    }
View Full Code Here

public abstract class AbstractModuleDescriptorParser implements ModuleDescriptorParser {
    public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
            boolean validate) throws ParseException, IOException {
        return parseDescriptor(ivySettings, descriptorURL,
            new URLResource(descriptorURL), validate);
    }
View Full Code Here

            // create a new temporary parser to read the configurations from
            // the specified file.
            Parser parser = new Parser(getModuleDescriptorParser(), settings);
            parser.setInput(url);
            parser.setMd(new DefaultModuleDescriptor(getModuleDescriptorParser(),
                    new URLResource(url)));
            XMLHelper.parse(url , null, parser);

            // add the configurations from this temporary parser to this module descriptor
            Configuration[] configs = parser.getModuleDescriptor().getConfigurations();
            for (int i = 0; i < configs.length; i++) {
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.repository.url.URLResource

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.