Package org.apache.ivy.core.module.id

Examples of org.apache.ivy.core.module.id.ModuleRevisionId


        }
        if (to == null) {
            throw new BuildException(
                    "no to resolver name: please provide it through parameter 'to'");
        }
        ModuleRevisionId mrid = ModuleRevisionId
                .newInstance(organisation, module, branch, revision);

        ResolveReport report;
        try {
            report = ivy.install(
View Full Code Here


        }
    }

    private static void setModuleVariables(ModuleDescriptor md, IvyVariableContainer variables,
            PomWriterOptions options) {
        ModuleRevisionId mrid = md.getModuleRevisionId();
        variables.setVariable("ivy.pom.groupId", mrid.getOrganisation(), true);

        String artifactId = options.getArtifactName();
        if (artifactId == null) {
            artifactId = mrid.getName();
        }

        String packaging = options.getArtifactPackaging();
        if (packaging == null) {
            // find artifact to determine the packaging
            Artifact artifact = findArtifact(md, artifactId);
            if (artifact == null) {
                // no suitable artifact found, default to 'pom'
                packaging = "pom";
            } else {
                packaging = artifact.getType();
            }
        }

        variables.setVariable("ivy.pom.artifactId", artifactId, true);
        variables.setVariable("ivy.pom.packaging", packaging, true);
        if (mrid.getRevision() != null) {
            variables.setVariable("ivy.pom.version", mrid.getRevision(), true);
        }
        if (options.getDescription() != null) {
            variables.setVariable("ivy.pom.description", options.getDescription(), true);
        }
        if (md.getHomePage() != null) {
View Full Code Here

            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);
                }
            }

            if (printDependencies) {
                indent(out, indent);
View Full Code Here

             * 0, it's because it's not possible to know which revision is greater. In this case we
             * consider the dynamic one to be greater, because most of the time it will then be
             * actually resolved and a real comparison will occur.
             */
            VersionMatcher vmatcher = IvyContext.getContext().getSettings().getVersionMatcher();
            ModuleRevisionId mrid1 = ModuleRevisionId.newInstance("", "", rev1);
            ModuleRevisionId mrid2 = ModuleRevisionId.newInstance("", "", rev2);

            if (vmatcher.isDynamic(mrid1)) {
                int c = vmatcher.compare(mrid1, mrid2, mridComparator);
                return c >= 0 ? 1 : -1;
            } else if (vmatcher.isDynamic(mrid2)) {
View Full Code Here

            scope = "compile";
        }

        String version = dep.getVersion();
        version = (version == null || version.length() == 0) ? getDefaultVersion(dep) : version;
        ModuleRevisionId moduleRevId = ModuleRevisionId.newInstance(dep.getGroupId(),
            dep.getArtifactId(), version);

        // Some POMs depend on theirselfves, don't add this dependency: Ivy doesn't allow this!
        // Example: http://repo2.maven.org/maven2/net/jini/jsk-platform/2.1/jsk-platform-2.1.pom
        ModuleRevisionId mRevId = ivyModuleDescriptor.getModuleRevisionId();
        if ((mRevId != null) && mRevId.getModuleId().equals(moduleRevId.getModuleId())) {
            return;
        }

        DefaultDependencyDescriptor dd = new PomDependencyDescriptor(dep, ivyModuleDescriptor,
                moduleRevId);
View Full Code Here

        // Some POMs depend on themselves through their parent pom, don't add this dependency
        // since Ivy doesn't allow this!
        // Example:
        // http://repo2.maven.org/maven2/com/atomikos/atomikos-util/3.6.4/atomikos-util-3.6.4.pom
        ModuleId dependencyId = descriptor.getDependencyId();
        ModuleRevisionId mRevId = ivyModuleDescriptor.getModuleRevisionId();
        if ((mRevId != null) && mRevId.getModuleId().equals(dependencyId)) {
            return;
        }

        ivyModuleDescriptor.addDependency(descriptor);
    }
View Full Code Here

                    + "It can either be set explicitely via the attribute 'module' or "
                    + "via 'ivy.module' property or a prior call to <resolve/>");
        } else if (module == null && !PatternMatcher.EXACT.equals(matcher)) {
            module = PatternMatcher.ANY_EXPRESSION;
        }
        ModuleRevisionId mrid = ModuleRevisionId.newInstance(organisation, module, revision);

        try {
            ModuleRevisionId criteria = null;

            if ((revision == null) || settings.getVersionMatcher().isDynamic(mrid)) {
                criteria = new ModuleRevisionId(new ModuleId(organisation, module), branch, "*");
            } else {
                criteria = new ModuleRevisionId(new ModuleId(organisation, module), branch,
                        revision);
            }

            ModuleRevisionId[] mrids = ivy.listModules(criteria, settings.getMatcher(matcher));

View Full Code Here

        if (result == null) {
            // search again, now ignore the missing extra attributes
            for (Iterator it = visitData.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Entry) it.next();
                ModuleRevisionId current = (ModuleRevisionId) entry.getKey();

                if (isSubMap(mrid.getAttributes(), current.getAttributes())) {
                    result = (VisitData) entry.getValue();
                    break;
                }
            }
        }
View Full Code Here

    public void doExecute() throws BuildException {
        prepareAndCheck();
        ResolveReport report = getResolvedReport();
        log("Dependency tree for " + report.getResolveId());
        ModuleRevisionId mrid = report.getModuleDescriptor().getModuleRevisionId();
        // make dependency tree easier to fetch informations
        for (Iterator iterator = report.getDependencies().iterator(); iterator.hasNext();) {
            IvyNode dependency = (IvyNode) iterator.next();
            populateDependencyTree(dependency, mrid, report);
        }
View Full Code Here

            throw new BuildException(
                    "no status provided: either provide it as parameter or through "
                            + "the ivy.status.default property");
        }

        ModuleRevisionId mrid = null;
        if (resolveId == null) {
            mrid = ModuleRevisionId.newInstance(organisation, module, revision);
        }
        boolean isLeading = false;
        try {
View Full Code Here

TOP

Related Classes of org.apache.ivy.core.module.id.ModuleRevisionId

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.