Package org.apache.ivy.plugins.parser.m2

Examples of org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser$Parser


                    + " from=" + ivyFile + " to=" + pomFile, e);
        }
    }
   
    private PomWriterOptions getPomWriterOptions() throws IOException {
        PomWriterOptions options = new PomWriterOptions();
        options.setConfs(splitConfs(conf))
               .setArtifactName(getArtifactName())
               .setArtifactPackaging(getArtifactPackaging())
               .setPrintIvyInfo(isPrintIvyInfo())
               .setDescription(getDescription())
               .setExtraDependencies(getDependencies())
               .setTemplate(getTemplateFile());
       
        if (!mappings.isEmpty()) {
            options.setMapping(new PomWriterOptions.ConfigurationScopeMapping(getMappingsMap()));
        }
       
        if (headerFile != null) {
            options.setLicenseHeader(FileUtil.readEntirely(getHeaderFile()));
        }
       
        return options;
    }
View Full Code Here


                printDependency(out, indent, groupId, dep.getArtifact(), version, dep.getType(),
                    dep.getClassifier(), dep.getScope(), dep.isOptional(), null);
            }

            // now print the dependencies listed in the ModuleDescriptor
            ConfigurationScopeMapping mapping = options.getMapping();
            if (mapping == null) {
                mapping = DEFAULT_MAPPING;
            }

            for (int i = 0; i < dds.length; i++) {
                ModuleRevisionId mrid = dds[i].getDependencyRevisionId();
                ExcludeRule[] excludes = null;
                if (dds[i].canExclude()) {
                    excludes = dds[i].getAllExcludeRules();
                }
                DependencyArtifactDescriptor[] dads = dds[i].getAllDependencyArtifacts();
                if (dads.length > 0) {
                    for (int j = 0; j < dads.length; j++) {
                        String type = dads[j].getType();
                        String classifier = dads[j].getExtraAttribute("classifier");
                        String scope = mapping.getScope(dds[i].getModuleConfigurations());
                        boolean optional = mapping.isOptional(dds[i].getModuleConfigurations());
                        printDependency(out, indent, mrid.getOrganisation(), mrid.getName(),
                            mrid.getRevision(), type, classifier, scope, optional, excludes);
                    }
                } else {
                    String scope = mapping.getScope(dds[i].getModuleConfigurations());
                    boolean optional = mapping.isOptional(dds[i].getModuleConfigurations());
                    printDependency(out, indent, mrid.getOrganisation(), mrid.getName(),
                        mrid.getRevision(), null, null, scope, optional, excludes);
                }
            }
View Full Code Here

                printDependency(out, indent, groupId, dep.getArtifact(), version, dep.getType(),
                        dep.getClassifier(), dep.getScope(), dep.isOptional(), null);
            }
           
            // now print the dependencies listed in the ModuleDescriptor
            ConfigurationScopeMapping mapping = options.getMapping();
            if (mapping == null) {
                mapping = DEFAULT_MAPPING;
            }
           
            for (int i = 0; i < dds.length; i++) {
                ModuleRevisionId mrid = dds[i].getDependencyRevisionId();
                ExcludeRule[] excludes = null;
                if(dds[i].canExclude()){
                    excludes = dds[i].getAllExcludeRules();
                }
                DependencyArtifactDescriptor[] dads = dds[i].getAllDependencyArtifacts();
                if(dads.length > 0) {
                    for (int j = 0; j < dads.length; j++) {
                        String type = dads[j].getType();
                        String classifier = dads[j].getExtraAttribute("classifier");
                        String scope = mapping.getScope(dds[i].getModuleConfigurations());
                        boolean optional = mapping.isOptional(dds[i].getModuleConfigurations());
                        printDependency(out, indent, mrid.getOrganisation(), mrid.getName(),
                                mrid.getRevision(), type, classifier, scope, optional, excludes);
                    }
                }
                else {
                    String scope = mapping.getScope(dds[i].getModuleConfigurations());
                    boolean optional = mapping.isOptional(dds[i].getModuleConfigurations());
                    printDependency(out, indent, mrid.getOrganisation(), mrid.getName(),
                            mrid.getRevision(), null, null, scope, optional, excludes);
                }
            }
           
View Full Code Here

                indent(out, indent * 2);
                out.println("</dependency>");
            }
           
            // now print the dependencies listed in the ModuleDescriptor
            ConfigurationScopeMapping mapping = options.getMapping();
            if (mapping == null) {
                mapping = DEFAULT_MAPPING;
            }
           
            for (int i = 0; i < dds.length; i++) {
                ModuleRevisionId mrid = dds[i].getDependencyRevisionId();
                indent(out, indent * 2);
                out.println("<dependency>");
                indent(out, indent * 3);
                out.println("<groupId>" + mrid.getOrganisation() + "</groupId>");
                indent(out, indent * 3);
                out.println("<artifactId>" + mrid.getName() + "</artifactId>");
                indent(out, indent * 3);
                out.println("<version>" + mrid.getRevision() + "</version>");
                String scope = mapping.getScope(dds[i].getModuleConfigurations());
                if (scope != null) {
                    indent(out, indent * 3);
                    out.println("<scope>" + scope + "</scope>");
                }
                if (mapping.isOptional(dds[i].getModuleConfigurations())) {
                    indent(out, indent * 3);
                    out.println("<optional>true</optional>");
                }
                indent(out, indent * 2);
                out.println("</dependency>");
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
        QueryObjectModelFactoryImpl factory = new QOMF(resolver);
        ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
        parser = new Parser(factory, vf);
    }
View Full Code Here

        super.setUp();
        WorkspaceImpl wsp = (WorkspaceImpl) superuser.getWorkspace();
        QueryManagerImpl qm = (QueryManagerImpl) wsp.getQueryManager();
        QueryObjectModelFactoryImpl factory = (QueryObjectModelFactoryImpl) qm
                .getQOMFactory();
        parser = new Parser(factory, superuser.getValueFactory());
    }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

TOP

Related Classes of org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser$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.