Package org.apache.maven.model

Examples of org.apache.maven.model.Activation


    private Map<String, Activation> getProfileActivations( Model model, boolean clone )
    {
        Map<String, Activation> activations = new HashMap<String, Activation>();
        for ( Profile profile : model.getProfiles() )
        {
            Activation activation = profile.getActivation();

            if ( activation == null )
            {
                continue;
            }

            if ( clone )
            {
                activation = activation.clone();
            }

            activations.put( profile.getId(), activation );
        }
View Full Code Here


    private void injectProfileActivations( Model model, Map<String, Activation> activations )
    {
        for ( Profile profile : model.getProfiles() )
        {
            Activation activation = profile.getActivation();

            if ( activation == null )
            {
                continue;
            }
View Full Code Here

                ") with new instance from source: " + profile.getSource() );
        }

        profilesById.put( profile.getId(), profile );

        Activation activation = profile.getActivation();

        if ( activation != null && activation.isActiveByDefault() )
        {
            activateAsDefault( profileId );
        }
    }
View Full Code Here

{
    private static final String JDK_VERSION = System.getProperty( "java.version" );

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

        String jdk = activation.getJdk();
       
        boolean reverse = false;
       
        if ( jdk.startsWith( "!" ) )
        {
View Full Code Here

    implements ProfileActivator
{

    public boolean canDetermineActivation( Profile profile )
    {
        Activation activation = profile.getActivation();
        return activation != null && activation.getOs() != null;
    }
View Full Code Here

        return activation != null && activation.getOs() != null;
    }

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

        boolean result = ensureAtLeastOneNonNull( os );

        if ( result && os.getFamily() != null )
        {
View Full Code Here

        return profile.getActivation() != null && profile.getActivation().getFile() != null;
    }

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

        ActivationFile actFile = activation.getFile();

        if ( actFile != null )
        {
            // check if the file exists, if it does then the profile will be active
            String fileString = actFile.getExists();
View Full Code Here

        return profile.getActivation() != null && profile.getActivation().getProperty() != null;
    }

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

        ActivationProperty property = activation.getProperty();

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

    public void testShouldActivateDefaultProfile() throws ProfileActivationException
    {
        Profile notActivated = new Profile();
        notActivated.setId("notActivated");
       
        Activation nonActivation = new Activation();
       
        nonActivation.setJdk("19.2");
       
        notActivated.setActivation( nonActivation );
       
        Profile defaultActivated = new Profile();
        defaultActivated.setId("defaultActivated");
       
        Activation defaultActivation = new Activation();
       
        defaultActivation.setActiveByDefault(true);
       
        defaultActivated.setActivation( defaultActivation );
       
        ProfileManager profileManager = new DefaultProfileManager(getContainer());
       
View Full Code Here

    public void testShouldNotActivateDefaultProfile() throws ProfileActivationException
    {
        Profile syspropActivated = new Profile();
        syspropActivated.setId("syspropActivated");
       
        Activation syspropActivation = new Activation();
       
        ActivationProperty syspropProperty = new ActivationProperty();
        syspropProperty.setName("java.version");
       
        syspropActivation.setProperty(syspropProperty);
       
        syspropActivated.setActivation( syspropActivation );
       
        Profile defaultActivated = new Profile();
        defaultActivated.setId("defaultActivated");
       
        Activation defaultActivation = new Activation();
       
        defaultActivation.setActiveByDefault(true);
       
        defaultActivated.setActivation( defaultActivation );
       
        ProfileManager profileManager = new DefaultProfileManager(getContainer());
       
View Full Code Here

TOP

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

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.