Package org.apache.maven.artifact.versioning

Examples of org.apache.maven.artifact.versioning.Restriction


        if ( recommendedVersion == null )
        {

            for ( Iterator i = allowedRange.getRestrictions().iterator(); i.hasNext() && !matched; )
            {
                Restriction restriction = (Restriction) i.next();
                if ( restriction.containsVersion( theVersion ) )
                {
                    matched = true;
                }
            }
        }
View Full Code Here


      try {
        org.apache.maven.artifact.versioning.VersionRange vr = org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(dep.getVersion());
        List<Restriction> restrictions = vr.getRestrictions();
        if(restrictions.size() == 1) {
          Restriction r = restrictions.get(0);
          Version lower = r.getLowerBound() == null
              ? Version.MIN
              : Version.create(r.getLowerBound().toString());
          Version upper = r.getUpperBound() == null
              ? Version.MAX
              : Version.create(r.getUpperBound().toString());

          Dependency forgeDep = new Dependency();
          String dgid = mavenProject.getGroupId();
          String downer = dgid.substring(dgid.lastIndexOf('.') + 1);
          forgeDep.setName(ModuleName.create(downer, dep.getArtifactId(), true));
          forgeDep.setVersionRequirement(VersionRange.create(
            lower, r.isLowerBoundInclusive(), upper, r.isUpperBoundInclusive()));

          if(forgeDeps == null)
            forgeDeps = new ArrayList<Dependency>();
          forgeDeps.add(forgeDep);
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.versioning.Restriction

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.