Examples of ArtifactVersion


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

    public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
    {
        try
        {
            ArtifactVersion version1 = node1.getArtifact().getSelectedVersion();
            ArtifactVersion version2 = node2.getArtifact().getSelectedVersion();

            return version1.compareTo( version2 ) > 0 ? node1 : node2;
        }
        catch ( OverConstrainedVersionException exception )
        {
View Full Code Here

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

    public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
    {
        try
        {
            ArtifactVersion version1 = node1.getArtifact().getSelectedVersion();
            ArtifactVersion version2 = node2.getArtifact().getSelectedVersion();

            return version1.compareTo( version2 ) <= 0 ? node1 : node2;
        }
        catch ( OverConstrainedVersionException exception )
        {
View Full Code Here

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

     * @param theVersion   the version to be checked.
     * @return true if the version is contained by the range.
     */
    public static boolean containsVersion( VersionRange allowedRange, ArtifactVersion theVersion )
    {
        ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion();
        if ( recommendedVersion == null )
        {
            @SuppressWarnings( "unchecked" )
            List<Restriction> restrictions = allowedRange.getRestrictions();
            for ( Restriction restriction : restrictions )
            {
                if ( restriction.containsVersion( theVersion ) )
                {
                    return true;
                }
            }
        }

        // only singular versions ever have a recommendedVersion
        return recommendedVersion.compareTo( theVersion ) <= 0;
    }
View Full Code Here

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

     * @return true if the version is contained by the range.
     */
    public static boolean containsVersion( VersionRange allowedRange, ArtifactVersion theVersion )
    {
        boolean matched = false;
        ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion();
        if ( recommendedVersion == null )
        {
            @SuppressWarnings( "unchecked" )
            List<Restriction> restrictions = allowedRange.getRestrictions();
            for ( Restriction restriction :  restrictions )
            {
                if ( restriction.containsVersion( theVersion ) )
                {
                    matched = true;
                    break;
                }
            }
        }
        else
        {
            // only singular versions ever have a recommendedVersion
            @SuppressWarnings( "unchecked" )
            int compareTo = recommendedVersion.compareTo( theVersion );
            matched = ( compareTo <= 0 );
        }
        return matched;
    }
View Full Code Here

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

        throws EnforcerRuleException
    {
        try
        {
            RuntimeInformation rti = (RuntimeInformation) helper.getComponent( RuntimeInformation.class );
            ArtifactVersion detectedMavenVersion = rti.getApplicationVersion();
            helper.getLog().debug( "Detected Maven Version: " + detectedMavenVersion );
            enforceVersion( helper.getLog(), "Maven", getVersion(), detectedMavenVersion );
        }
        catch ( ComponentLookupException e )
        {
View Full Code Here

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

        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

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

                {
                    resolvedPair = hopPair;
                }
            }

            ArtifactVersion resolvedVersion = resolvedPair.extractArtifactVersion( uniqueVersions, false );

            for ( DependencyNodeHopCountPair pair : pairs )
            {
                ArtifactVersion version = pair.extractArtifactVersion( uniqueVersions, true );
                if ( resolvedVersion.compareTo( version ) < 0 )
                {
                    return true;
                }
            }
View Full Code Here

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

            if ( compileArtifactMap.get( newArtifact.getDependencyConflictId() ) != null )
            {
                Artifact oldArtifact = compileArtifactMap.get( newArtifact.getDependencyConflictId() );

                ArtifactVersion oldVersion = new DefaultArtifactVersion( oldArtifact.getVersion() );
                ArtifactVersion newVersion = new DefaultArtifactVersion( newArtifact.getVersion() );
                if ( newVersion.compareTo( oldVersion ) > 0 )
                {
                    compileArtifactMap.put( newArtifact.getDependencyConflictId(), newArtifact );
                }
            }
            else
View Full Code Here

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

     * @return
     */
    public static String getArtifactVersion( String[] artifactIds, List dependencies, int len )
    {
        String version = null;
        ArtifactVersion artifactVersion = getArtifactVersion( artifactIds, dependencies );
        if ( artifactVersion != null )
        {
            StringBuffer versionBuffer = new StringBuffer();
            if( len >= 1 )
            {
                versionBuffer.append( artifactVersion.getMajorVersion() );
            }
            if( len >= 2 )
            {
                versionBuffer.append( '.' );
            }           
            if( len >= 3 )
            {
                versionBuffer.append( artifactVersion.getMinorVersion() );
            }
            if( len >= 4 )
            {
                versionBuffer.append( '.' );
            }           
            if( len >= 5 )
            {
                versionBuffer.append( artifactVersion.getIncrementalVersion() );
            }
            version = versionBuffer.toString();
        }
        return version;
    }
View Full Code Here

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

    protected boolean isMavenVersion( String version )
    {
        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
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.