Package org.eclipse.aether.version

Examples of org.eclipse.aether.version.Version


            final Artifact artifact = coordsToArtifact(coords, type);
            final String version;
            if (isVersionRange(artifact.getVersion())) {
                final VersionRangeRequest request = new VersionRangeRequest().setRepositories(repos).setArtifact(artifact);
                final VersionRangeResult result = system.resolveVersionRange(session, request);
                final Version highestVersion = result.getHighestVersion();
                version = highestVersion != null ? highestVersion.toString() : null;
            } else {
                final VersionRequest request = new VersionRequest().setRepositories(repos).setArtifact(artifact);
                final VersionResult result = system.resolveVersion(session, request);
                version = result.getVersion();
            }
View Full Code Here


            VersionRangeResult rangeResult = system.resolveVersionRange(session, rangeRequest);

            List<Version> versions = Lists.reverse(rangeResult.getVersions());

//            Version matchedVersion = rangeRequest.;
            Version matchedVersion = null;

            if(!snapshots) {
                for (int i = 0; i < versions.size(); i++) {
                    Version version = versions.get(i);
                    if (!version.toString().toUpperCase().contains("SNAPSHOT")) {
                        matchedVersion = version;
                        break;
                    }
                }
                if(matchedVersion == null){
View Full Code Here

public class Versions {
    public static final VersionConstraint ANY = newConstConstraint("ANY", true);
    public static final Version ANY_VERSION = newAnyVersion("ANY", 0);

    private static Version newAnyVersion(final String s, final int compareTo) {
        return new Version() {
            @Override
            public int compareTo(Version o) {
                return compareTo;
            }
View Full Code Here

    private Artifact getLatestVersion0(String coords) {
        try {
            final Artifact artifact = coordsToArtifact(coords, "jar");
            final VersionRangeRequest versionRangeRequest = new VersionRangeRequest().setRepositories(repos).setArtifact(artifact);
            final VersionRangeResult versionRangeResult = system.resolveVersionRange(session, versionRangeRequest);
            final Version highestVersion = versionRangeResult.getHighestVersion();
            if (highestVersion == null)
                throw new RuntimeException("Could not find any version of artifact " + coords + " (looking for: " + artifact + ")");
            return artifact.setVersion(highestVersion.toString());
        } catch (VersionRangeResolutionException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    private Artifact getLatestVersion0(String coords) {
        try {
            final Artifact artifact = coordsToArtifact(coords, "jar");
            final VersionRangeRequest versionRangeRequest = new VersionRangeRequest().setRepositories(repos).setArtifact(artifact);
            final VersionRangeResult versionRangeResult = system.resolveVersionRange(session, versionRangeRequest);
            final Version highestVersion = versionRangeResult.getHighestVersion();
            if (highestVersion == null)
                throw new RuntimeException("Could not find any version of artifact " + coords + " (looking for: " + artifact + ")");
            return artifact.setVersion(highestVersion.toString());
        } catch (VersionRangeResolutionException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    private Artifact getLatestVersion(String coords) {
        try {
            final Artifact artifact = coordsToArtifact(coords, "jar");
            final VersionRangeRequest versionRangeRequest = new VersionRangeRequest().setRepositories(repos).setArtifact(artifact);
            final VersionRangeResult versionRangeResult = system.resolveVersionRange(session, versionRangeRequest);
            final Version highestVersion = versionRangeResult.getHighestVersion();
            if (highestVersion == null)
                throw new RuntimeException("Could not find any version of artifact " + coords + " (looking for: " + artifact + ")");
            return artifact.setVersion(highestVersion.toString());
        } catch (VersionRangeResolutionException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    private Artifact resolveUpdateArtifact(final Artifact updateRangeArtifact)
    throws RepositoryException {
        final VersionRangeResult result =
                resolveVersionRange(versionRangeRequest(updateRangeArtifact));
        final @CheckForNull Version highestVersion =
                result.getHighestVersion();
        if (null == highestVersion)
            throw new VersionRangeResolutionException(result,
                    "Update artifact not found.");
        return updateRangeArtifact.setVersion(highestVersion.toString());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.aether.version.Version

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.