Package org.apache.maven.model

Examples of org.apache.maven.model.Prerequisites


    {
        try
        {
            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
           
            Prerequisites prerequisites = project.getPrerequisites();
           
            if( prerequisites == null )
            {
                throw new EnforcerRuleException( "Requires prerequisite not set" );
            }

            if( mavenVersion != null )
            {
               
                VersionRange requiredVersionRange = VersionRange.createFromVersionSpec( mavenVersion );
               
                if( !requiredVersionRange.hasRestrictions() )
                {
                    requiredVersionRange = VersionRange.createFromVersionSpec( "[" + mavenVersion + ",)" );
                }
               
                VersionRange specifiedVersion = VersionRange.createFromVersionSpec( prerequisites.getMaven() );
               
                VersionRange restrictedVersionRange = requiredVersionRange.restrict( specifiedVersion );
               
                if ( restrictedVersionRange.getRecommendedVersion() == null )
                {
View Full Code Here


     * @return Prerequisites
     */
    private Prerequisites parsePrerequisites( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Prerequisites prerequisites = new Prerequisites();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "maven", null, parsed ) )
            {
                prerequisites.setMaven( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

                }
            }

            Map<String, Object> properties = new LinkedHashMap<String, Object>();

            Prerequisites prerequisites = model.getPrerequisites();
            if ( prerequisites != null )
            {
                properties.put( "prerequisites.maven", prerequisites.getMaven() );
            }

            List<License> licenses = model.getLicenses();
            properties.put( "license.count", licenses.size() );
            for ( int i = 0; i < licenses.size(); i++ )
View Full Code Here

    }

    protected void mergeModel_Prerequisites( Model target, Model source, boolean sourceDominant,
                                             Map<Object, Object> context )
    {
        Prerequisites src = source.getPrerequisites();
        if ( source.getPrerequisites() != null )
        {
            Prerequisites tgt = target.getPrerequisites();
            if ( tgt == null )
            {
                tgt = new Prerequisites();
                target.setPrerequisites( tgt );
            }
            mergePrerequisites( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

                }
            }

            Map<String, Object> properties = new LinkedHashMap<String, Object>();

            Prerequisites prerequisites = model.getPrerequisites();
            if ( prerequisites != null )
            {
                properties.put( "prerequisites.maven", prerequisites.getMaven() );
            }

            List<License> licenses = model.getLicenses();
            properties.put( "license.count", licenses.size() );
            for ( int i = 0; i < licenses.size(); i++ )
View Full Code Here

    }

    protected void mergeModel_Prerequisites( Model target, Model source, boolean sourceDominant,
                                             Map<Object, Object> context )
    {
        Prerequisites src = source.getPrerequisites();
        if ( src != null )
        {
            Prerequisites tgt = target.getPrerequisites();
            if ( tgt == null )
            {
                tgt = new Prerequisites();
                tgt.setMaven( null );
                target.setPrerequisites( tgt );
            }
            mergePrerequisites( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

                }
            }

            Map<String, Object> properties = new LinkedHashMap<String, Object>();

            Prerequisites prerequisites = model.getPrerequisites();
            if ( prerequisites != null )
            {
                properties.put( "prerequisites.maven", prerequisites.getMaven() );
            }

            List<License> licenses = model.getLicenses();
            properties.put( "license.count", licenses.size() );
            for ( int i = 0; i < licenses.size(); i++ )
View Full Code Here

    }

    protected void mergeModel_Prerequisites( Model target, Model source, boolean sourceDominant,
                                             Map<Object, Object> context )
    {
        Prerequisites src = source.getPrerequisites();
        if ( source.getPrerequisites() != null )
        {
            Prerequisites tgt = target.getPrerequisites();
            if ( tgt == null )
            {
                tgt = new Prerequisites();
                target.setPrerequisites( tgt );
            }
            mergePrerequisites( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

        if ( src == null )
        {
            return null;
        }
       
        Prerequisites result = new Prerequisites();
       
        result.setMaven( src.getMaven() );

        return result;
    }
View Full Code Here

     * @param parser
     */
    private Prerequisites parsePrerequisites(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Prerequisites prerequisites = new Prerequisites();
        prerequisites.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "maven" )  )
            {
                if ( parsed.contains( "maven" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "maven" );
                prerequisites.setMaven( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Prerequisites

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.