Package org.apache.maven.artifact.versioning

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


    private void assertMinScrAnnotationArtifactVersion(final Artifact a)
            throws MojoFailureException {
        if (SCR_ANN_ARTIFACTID.equals(a.getArtifactId())
                && SCR_ANN_GROUPID.equals(a.getGroupId())) {
            // assert minimal version number
            final ArtifactVersion aVersion = new DefaultArtifactVersion(a.getBaseVersion());
            if (SCR_ANN_MIN_VERSION.compareTo(aVersion) > 0) {
                getLog().error("Project depends on " + a);
                getLog().error(
                        "Minimum required version is " + SCR_ANN_MIN_VERSION);
                throw new MojoFailureException(
View Full Code Here


        Plugin bundlePlugin  = null;
        final List<Plugin> plugins = this.project.getBuildPlugins();
        for(final Plugin p : plugins) {
            if ( p.getArtifactId().equals(BUNDLE_PLUGIN_ARTIFACT_ID)
                 && p.getGroupId().equals(BUNDLE_PLUGIN_GROUP_ID) ) {
                final ArtifactVersion pluginVersion = new DefaultArtifactVersion(p.getVersion());
                final ArtifactVersion requiredMinVersion = new DefaultArtifactVersion("2.5.0");
                if ( pluginVersion.compareTo(requiredMinVersion) > 0 ) {
                    bundlePlugin = p;
                    break;
                }
            }
View Full Code Here

                        }
                    }
                    if ( result == 0 )
                    {
                        // We don't consider the version range in the comparison, just the resolved version
                        result = new DefaultArtifactVersion( version ).compareTo(
                            new DefaultArtifactVersion( a.getVersion() ) );
                    }
                }
            }
        }
        return result;
View Full Code Here

   
    if ( !isSlingBundleArchetype ) {
        return false;
    }
   
        DefaultArtifactVersion version = new DefaultArtifactVersion(archetype.getVersion());

        // release 1.0.2 is the first known good release
        if (version.compareTo(new DefaultArtifactVersion("1.0.2")) < 0) {
            return false;
        }

        return true;
   
View Full Code Here

                }

                // if we don't have the required Maven version, then ignore an update
                if ( pluginProject.getPrerequisites() != null && pluginProject.getPrerequisites().getMaven() != null )
                {
                    DefaultArtifactVersion requiredVersion =
                        new DefaultArtifactVersion( pluginProject.getPrerequisites().getMaven() );

                    if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
                    {
                        getLogger().info( "Ignoring available plugin update: " + artifactVersion +
                            " as it requires Maven version " + requiredVersion );
View Full Code Here

            MavenProject project =
                mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories, localRepository, false );
            // if we don't have the required Maven version, then ignore an update
            if ( ( project.getPrerequisites() != null ) && ( project.getPrerequisites().getMaven() != null ) )
            {
                DefaultArtifactVersion requiredVersion =
                    new DefaultArtifactVersion( project.getPrerequisites().getMaven() );
                if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
                {
                    throw new PluginVersionResolutionException( plugin.getGroupId(), plugin.getArtifactId(),
                                                                "Plugin requires Maven version " + requiredVersion );
                }
View Full Code Here

        for ( Iterator i = resolutionGroup.getArtifacts().iterator(); i.hasNext(); )
        {
            Artifact a = (Artifact) i.next();

            if ( a.getArtifactId().equals( "plexus-utils" ) &&
                vr.containsVersion( new DefaultArtifactVersion( a.getVersion() ) ) )
            {
                plexusUtilsPresent = true;

                break;
            }
View Full Code Here

                {
                    throw new ArtifactMetadataRetrievalException( e.getMessage(), e, artifact );
                }
                for ( String version : projectVersions )
                {
                    versions.add( new DefaultArtifactVersion( version ) );
                }
            }

            return new ArrayList<ArtifactVersion>( versions );
        }
View Full Code Here

            List metadataVersions = repoMetadata.getVersioning().getVersions();
            versions = new ArrayList( metadataVersions.size() );
            for ( Iterator i = metadataVersions.iterator(); i.hasNext(); )
            {
                String version = (String) i.next();
                versions.add( new DefaultArtifactVersion( version ) );
            }
        }
        else
        {
            versions = Collections.EMPTY_LIST;
View Full Code Here

                project.setExecutionRoot( true );
            }

            if ( ( project.getPrerequisites() != null ) && ( project.getPrerequisites().getMaven() != null ) )
            {
                DefaultArtifactVersion version = new DefaultArtifactVersion( project.getPrerequisites().getMaven() );
                if ( runtimeInformation.getApplicationVersion().compareTo( version ) < 0 )
                {
                    throw new BuildFailureException( "Unable to build project '" + project.getFile() +
                        "; it requires Maven version " + version.toString() );
                }
            }

            if ( ( project.getModules() != null ) && !project.getModules().isEmpty() && request.isRecursive() )
            {
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.