Package org.apache.maven.artifact.versioning

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


                if ( !groupId.equals( archetype.getGroupId() ) || !artifactId.equals( archetype.getArtifactId() ) )
                {
                    continue;
                }

                ArtifactVersion version = new DefaultArtifactVersion( archetype.getVersion() );

                // don't override the first catalog containing a defined version of the artifact
                if ( !archetypeVersionsMap.containsKey( version ) )
                {
                    archetypeVersionsMap.put( version, archetype );
View Full Code Here


        }

        Artifact testNgArtifact = getTestNgArtifact();
        if ( testNgArtifact != null){

            DefaultArtifactVersion defaultArtifactVersion = new DefaultArtifactVersion( testNgArtifact.getVersion() );
            getProperties().setProperty( "testng.configurator", getConfiguratorName( defaultArtifactVersion ) );
        }


    }
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

        if ( this.testNgVersion != null )
        {
            goals1.add( "-DtestNgVersion=" + testNgVersion );

            ArtifactVersion v = new DefaultArtifactVersion( testNgVersion );
            try
            {
                if ( VersionRange.createFromVersionSpec( "(,5.12.1)" ).containsVersion( v ) )
                {
                    goals1.add( "-DtestNgClassifier=jdk15" );
View Full Code Here

        List<ArtifactVersion> artifactVersions = new ArrayList<ArtifactVersion>( versions.size() );

        for ( String version : versions )
        {
            artifactVersions.add( new DefaultArtifactVersion( version ) );
        }

        return artifactVersions;
    }
View Full Code Here

    @Override
    public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
    {
        // sort by version (reverse), then ID
        int result =
            new DefaultArtifactVersion( o2.getVersion() ).compareTo( new DefaultArtifactVersion( o1.getVersion() ) );
        return result != 0 ? result : o1.getId().compareTo( o2.getId() );
    }
View Full Code Here

        List<ArtifactVersion> artifactVersions = new ArrayList<ArtifactVersion>( versions.size() );

        for ( String version : versions )
        {
            artifactVersions.add( new DefaultArtifactVersion( version ) );
        }

        return artifactVersions;
    }
View Full Code Here

            {
                try
                {
                    result =
                        AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( pattern[2] ),
                                                                 new DefaultArtifactVersion( artifact.getBaseVersion() ) );
                }
                catch ( InvalidVersionSpecificationException e )
                {
                    throw new EnforcerRuleException( "Invalid Version Range: ", e );
                }
View Full Code Here

        log.debug( "Detected Java String: " + javaVersion );
        javaVersion = normalizeJDKVersion( javaVersion );
        log.debug( "Normalized Java String: " + javaVersion );

        ArtifactVersion detectedJdkVersion = new DefaultArtifactVersion( javaVersion );

        log.debug( "Parsed Version: Major: " + detectedJdkVersion.getMajorVersion() + " Minor: "
            + detectedJdkVersion.getMinorVersion() + " Incremental: " + detectedJdkVersion.getIncrementalVersion()
            + " Build: " + detectedJdkVersion.getBuildNumber() + " Qualifier: " + detectedJdkVersion.getQualifier() );

        enforceVersion( helper.getLog(), "JDK", getVersion(), detectedJdkVersion );
    }
View Full Code Here

                case 3:
                    if ( !matches( parts[2], artifact.getVersion() ) )
                    {
                        if ( !AbstractVersionEnforcer.containsVersion( VersionRange.createFromVersionSpec( parts[2] ),
                                                                       new DefaultArtifactVersion(
                                                                                                   artifact.getVersion() ) ) )
                        {
                            return false;
                        }
                    }
View Full Code Here

TOP

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

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.