Package org.apache.maven.model

Examples of org.apache.maven.model.ActivationProperty


                newActivation.setFile( afNew );
            }

            newActivation.setJdk( activation.getJdk() );

            ActivationProperty ap = activation.getProperty();

            if ( ap != null )
            {
                ActivationProperty newAp = new ActivationProperty();

                newAp.setName( ap.getName() );
                newAp.setValue( ap.getValue() );

                newActivation.setProperty( newAp );
            }
        }
View Full Code Here


            org.apache.maven.profiles.ActivationProperty profileProp = profileActivation.getProperty();

            if ( profileProp != null )
            {
                ActivationProperty prop = new ActivationProperty();

                prop.setName( profileProp.getName() );
                prop.setValue( profileProp.getValue() );

                activation.setProperty( prop );
            }

           
View Full Code Here

            org.apache.maven.profiles.ActivationProperty profileProp = profileActivation.getProperty();

            if ( profileProp != null )
            {
                ActivationProperty prop = new ActivationProperty();

                prop.setName( profileProp.getName() );
                prop.setValue( profileProp.getValue() );

                activation.setProperty( prop );
            }

           
View Full Code Here

    public boolean isActive( Profile profile )
    {
        Activation activation = profile.getActivation();

        ActivationProperty property = activation.getProperty();

        if ( property != null )
        {
            String name = property.getName();
            boolean reverseName = false;
           
            if ( name.startsWith("!") )
            {
                reverseName = true;
                name = name.substring( 1 );
            }
           
            String sysValue = properties.getProperty( name );

            String propValue = property.getValue();
            if ( StringUtils.isNotEmpty( propValue ) )
            {
                boolean reverseValue = false;
                if ( propValue.startsWith( "!" ) )
                {
View Full Code Here

        if ( src == null )
        {
            return null;
        }
       
        ActivationProperty result = new ActivationProperty();
       
        result.setName( src.getName() );
        result.setValue( src.getValue() );
       
        return result;
    }
View Full Code Here

        if ( activation == null )
        {
            return false;
        }

        ActivationProperty property = activation.getProperty();

        if ( property == null )
        {
            return false;
        }

        String name = property.getName();
        boolean reverseName = false;

        if ( name != null && name.startsWith( "!" ) )
        {
            reverseName = true;
            name = name.substring( 1 );
        }

        if ( name == null || name.length() <= 0 )
        {
            problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
                    .setMessage( "The property name is required to activate the profile " + profile.getId() )
                    .setLocation( property.getLocation( "" ) ) );
            return false;
        }

        String sysValue = context.getUserProperties().get( name );
        if ( sysValue == null )
        {
            sysValue = context.getSystemProperties().get( name );
        }

        String propValue = property.getValue();
        if ( StringUtils.isNotEmpty( propValue ) )
        {
            boolean reverseValue = false;
            if ( propValue.startsWith( "!" ) )
            {
View Full Code Here

     * @return ActivationProperty
     */
    private ActivationProperty parseActivationProperty( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        ActivationProperty activationProperty = new ActivationProperty();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                activationProperty.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "value", null, parsed ) )
            {
                activationProperty.setValue( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

    public boolean isActive( Profile profile )
        throws ProfileActivationException
    {
        Activation activation = profile.getActivation();

        ActivationProperty property = activation.getProperty();

        if ( property != null )
        {
            String name = property.getName();
            boolean reverseName = false;

            if ( name == null )
            {
                throw new ProfileActivationException( "The property name is required to activate the profile '"
                    + profile.getId() + "'" );
            }

            if ( name.startsWith( "!" ) )
            {
                reverseName = true;
                name = name.substring( 1 );
            }

            String sysValue = properties.getProperty( name );

            String propValue = property.getValue();
            if ( StringUtils.isNotEmpty( propValue ) )
            {
                boolean reverseValue = false;
                if ( propValue.startsWith( "!" ) )
                {
View Full Code Here

            org.apache.maven.profiles.ActivationProperty profileProp = profileActivation.getProperty();

            if ( profileProp != null )
            {
                ActivationProperty prop = new ActivationProperty();

                prop.setName( profileProp.getName() );
                prop.setValue( profileProp.getValue() );

                activation.setProperty( prop );
            }

           
View Full Code Here

        Activation activation = profile.getActivation();

        if ( activation != null )
        {
            ActivationProperty property = activation.getProperty();

            if ( property != null )
            {
                String name = property.getName();
                boolean reverseName = false;

                if ( name != null && name.startsWith( "!" ) )
                {
                    reverseName = true;
                    name = name.substring( 1 );
                }

                if ( name == null || name.length() <= 0 )
                {
                    problems.add( Severity.ERROR, "The property name is required to activate the profile "
                        + profile.getId(), property.getLocation( "" ), null );
                    return false;
                }

                String sysValue = context.getUserProperties().get( name );
                if ( sysValue == null )
                {
                    sysValue = context.getSystemProperties().get( name );
                }

                String propValue = property.getValue();
                if ( StringUtils.isNotEmpty( propValue ) )
                {
                    boolean reverseValue = false;
                    if ( propValue.startsWith( "!" ) )
                    {
View Full Code Here

TOP

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

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.