Package org.apache.maven.artifact.versioning

Examples of org.apache.maven.artifact.versioning.VersionRange.containsVersion()


        {
            try
            {
                VersionRange range = VersionRange.createFromVersionSpec(requirement);
                if (range.hasRestrictions()) {
                    return range.containsVersion(version);
                } else {
                    return range.getRecommendedVersion().compareTo(version) == 0;
                }
            }
            catch (InvalidVersionSpecificationException ex)
View Full Code Here


        Artifact artifact = getProjectArtifactMap().get( getTestNGArtifactName() );

        if ( artifact != null )
        {
            VersionRange range = createVersionRange();
            if ( !range.containsVersion( new DefaultArtifactVersion( artifact.getVersion() ) ) )
            {
                throw new MojoExecutionException(
                    "TestNG support requires version 4.7 or above. You have declared version "
                        + artifact.getVersion() );
            }
View Full Code Here

        throws TestSetFailedException
    {
        try
        {
            VersionRange range = VersionRange.createFromVersionSpec( "[4.7,5.1]" );
            if ( range.containsVersion( version ) )
            {
                return new TestNG4751Configurator();
            }
            range = VersionRange.createFromVersionSpec( "[5.2]" );
            if ( range.containsVersion( version ) )
View Full Code Here

            if ( range.containsVersion( version ) )
            {
                return new TestNG4751Configurator();
            }
            range = VersionRange.createFromVersionSpec( "[5.2]" );
            if ( range.containsVersion( version ) )
            {
                return new TestNG52Configurator();
            }
            range = VersionRange.createFromVersionSpec( "[5.3,6.4]" );
            if ( range.containsVersion( version ) )
View Full Code Here

            if ( range.containsVersion( version ) )
            {
                return new TestNG52Configurator();
            }
            range = VersionRange.createFromVersionSpec( "[5.3,6.4]" );
            if ( range.containsVersion( version ) )
            {
                return new TestNGMapConfigurator();
            }
            range = VersionRange.createFromVersionSpec( "[6.5,)" );
            if ( range.containsVersion( version ) )
View Full Code Here

            if ( range.containsVersion( version ) )
            {
                return new TestNGMapConfigurator();
            }
            range = VersionRange.createFromVersionSpec( "[6.5,)" );
            if ( range.containsVersion( version ) )
            {
                return new TestNG652Configurator();
            }

            throw new TestSetFailedException( "Unknown TestNG version " + version );
View Full Code Here

        Artifact artifact = getProjectArtifactMap().get( getTestNGArtifactName() );

        if ( artifact != null )
        {
            VersionRange range = createVersionRange();
            if ( !range.containsVersion( new DefaultArtifactVersion( artifact.getVersion() ) ) )
            {
                throw new MojoExecutionException(
                    "TestNG support requires version 4.7 or above. You have declared version "
                        + artifact.getVersion() );
            }
View Full Code Here

                    artifactMetadataSource.retrieveAvailableVersions( artifact, localRepository, remoteRepositories );
   
                // only use versions from range
                for ( Iterator<ArtifactVersion> iter = versions.iterator(); iter.hasNext(); )
                {
                    if ( ! range.containsVersion( iter.next() ) )
                    {
                        iter.remove();
                    }
                }
View Full Code Here

            testNgArtifact = (Artifact) projectArtifactMap.get( testNGArtifactName );

            if ( testNgArtifact != null )
            {
                VersionRange range = VersionRange.createFromVersionSpec( "[4.7,)" );
                if ( !range.containsVersion( new DefaultArtifactVersion(testNgArtifact.getVersion()) ) )
                {
                    throw new MojoFailureException(
                                                    "TestNG support requires version 4.7 or above. You have declared version " +
                                                        testNgArtifact.getVersion() );
                }
View Full Code Here

  private void checkVersion(String artifactName, String versionSpec, Artifact artifact)
      throws MojoExecutionException {
    VersionRange range;
    try {
      range = VersionRange.createFromVersionSpec(versionSpec);
      if (!range.containsVersion(new DefaultArtifactVersion(artifact.getVersion())))
      {
          throw new MojoExecutionException(
              "JUnit4 plugin requires " + artifactName + " in version " +
              versionSpec + " among project dependencies, you declared: "
                  + artifact.getVersion());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.