Package org.apache.maven.artifact.versioning

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


  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


  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

        try
        {
            VersionRange range = VersionRange.createFromVersionSpec( versionSpec );
            try
            {
                return range.containsVersion( artifact.getSelectedVersion() );
            }
            catch ( NullPointerException e )
            {
                return range.containsVersion( new DefaultArtifactVersion( artifact.getBaseVersion() ) );
            }
View Full Code Here

            {
                return range.containsVersion( artifact.getSelectedVersion() );
            }
            catch ( NullPointerException e )
            {
                return range.containsVersion( new DefaultArtifactVersion( artifact.getBaseVersion() ) );
            }
        }
        catch ( InvalidVersionSpecificationException e )
        {
            throw new RuntimeException( "Bug in plugin. Please report with stacktrace" );
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

  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

                    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

    {
        try
        {
            VersionRange versionRange = VersionRange.createFromVersionSpec( version );
            ArtifactVersion mavenVersion = runtimeInformation.getApplicationVersion();
            return versionRange.containsVersion( mavenVersion );
        }
        catch ( InvalidVersionSpecificationException e )
        {
            throw new IllegalArgumentException( e.getMessage() );
        }
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

  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.