Examples of DefaultArtifactVersion


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

            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.DefaultArtifactVersion

  }

  private ArtifactVersion determineArtifactVersion(Artifact artifact) throws MojoExecutionException {
    try {
      return artifact.getVersion() != null
          ? new DefaultArtifactVersion( artifact.getVersion() )
          : artifact.getSelectedVersion();
    }
    catch ( OverConstrainedVersionException e ) {
      throw new MojoExecutionException( "artifact [" + artifact.getId() + "] defined an overly constrained version range" );
    }
View Full Code Here

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

        result = 31 * result + (type != null ? type.hashCode() : 0);
        return result;
    }

    public void setArtifactVersion(String version) {
        artifactVersion = new DefaultArtifactVersion(version);
    }
View Full Code Here

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

                        public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
                        {
                            // sort by version (reverse), then ID
                            // TODO: move version sorting into repository handling (maven2 specific), and perhaps add a
                            // way to get latest instead
                            int result = new DefaultArtifactVersion( o2.getVersion() ).compareTo(
                                new DefaultArtifactVersion( o1.getVersion() ) );
                            return result != 0 ? result : o1.getId().compareTo( o2.getId() );
                        }
                    } );

                    for ( ArtifactMetadata artifact : artifacts )
View Full Code Here

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

                artifactVersions = new ArrayList();
                versions.put( key, artifactVersions );
            }
            if ( spec.artifact.getVersion() != null )
            {
                artifactVersions.add( new DefaultArtifactVersion( spec.artifact.getVersion() ) );
            }
        }
View Full Code Here

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

                artifactVersions = new ArrayList();
                versions.put( key, artifactVersions );
            }
            if ( spec.artifact.getVersion() != null )
            {
                artifactVersions.add( new DefaultArtifactVersion( spec.artifact.getVersion() ) );
            }
        }
View Full Code Here

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

        if ( StringUtils.isEmpty( mavenVersion ) )
        {
            throw new InitializationException( "Unable to read Maven version from maven-core" );
        }

        applicationVersion = new DefaultArtifactVersion( mavenVersion );
    }
View Full Code Here

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

            if ( property == null )
            {
                throw new InitializationException( "maven-core properties did not include the version" );
            }

            applicationVersion = new DefaultArtifactVersion( property );
        }
        catch ( IOException e )
        {
            throw new InitializationException( "Unable to read properties file from maven-core", e );
        }
View Full Code Here

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

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

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

        return artifactVersions;
    }
View Full Code Here

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

     * Convert the maven version into OSGi version
     * @param mavenVersion
     * @return
     */
    static String osgiVersion(String mavenVersion) {
        ArtifactVersion ver = new DefaultArtifactVersion(mavenVersion);
        String qualifer = ver.getQualifier();
        if (qualifer != null) {
            StringBuffer buf = new StringBuffer(qualifer);
            for (int i = 0; i < buf.length(); i++) {
                char c = buf.charAt(i);
                if (Character.isLetterOrDigit(c) || c == '-' || c == '_') {
                    // Keep as-is
                } else {
                    buf.setCharAt(i, '_');
                }
            }
            qualifer = buf.toString();
        }
        Version osgiVersion =
            new Version(ver.getMajorVersion(), ver.getMinorVersion(), ver.getIncrementalVersion(), qualifer);
        String version = osgiVersion.toString();
        return version;
    }
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.