Package org.apache.maven.model

Examples of org.apache.maven.model.Activation


    public void testShouldNotActivateReversalOfPresentSystemProperty() 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 );
       
        ProfileManager profileManager = new DefaultProfileManager(getContainer());
       
View Full Code Here


    public void testShouldOverrideAndActivateInactiveProfile() 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 );
       
        ProfileManager profileManager = new DefaultProfileManager(getContainer());
       
View Full Code Here

    public void testShouldOverrideAndDeactivateActiveProfile() 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 );
       
        ProfileManager profileManager = new DefaultProfileManager(getContainer());
       
View Full Code Here

   public void testOsActivationProfile() throws ProfileActivationException
    {
        Profile osActivated = new Profile();
        osActivated.setId("os-profile");

        Activation osActivation = new Activation();

        ActivationOS activationOS = new ActivationOS();

        activationOS.setName("!dddd");

        osActivation.setOs(activationOS);

        osActivated.setActivation(osActivation);

        ProfileManager profileManager = new DefaultProfileManager(getContainer());
View Full Code Here

        org.apache.maven.profiles.Activation profileActivation = profileXmlProfile.getActivation();

        if ( profileActivation != null )
        {
            Activation activation = new Activation();

            activation.setActiveByDefault( profileActivation.isActiveByDefault() );

            activation.setJdk( profileActivation.getJdk() );

            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 );
            }

           
            ActivationOS profileOs = profileActivation.getOs();
           
            if ( profileOs != null )
            {
                org.apache.maven.model.ActivationOS os = new org.apache.maven.model.ActivationOS();

                os.setArch( profileOs.getArch() );
                os.setFamily( profileOs.getFamily() );
                os.setName( profileOs.getName() );
                os.setVersion( profileOs.getVersion() );
            }
           
            org.apache.maven.profiles.ActivationFile profileFile = profileActivation.getFile();

            if ( profileFile != null )
            {
                ActivationFile file = new ActivationFile();

                file.setExists( profileFile.getExists() );
                file.setMissing( profileFile.getMissing() );

                activation.setFile( file );
            }

            profile.setActivation( activation );
        }
        else
View Full Code Here

        return newExecs;
    }

    private static Activation cloneProfileActivation( Activation activation )
    {
        Activation newActivation = null;
        if ( activation != null )
        {
            newActivation = new Activation();

            newActivation.setActiveByDefault( activation.isActiveByDefault() );

            ActivationFile af = activation.getFile();

            if ( af != null )
            {
                ActivationFile afNew = new ActivationFile();
                afNew.setExists( af.getExists() );
                afNew.setMissing( af.getMissing() );

                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 );
            }
        }

        return newActivation;
    }
View Full Code Here

        return newExecs;
    }

    private static Activation cloneProfileActivation( Activation activation )
    {
        Activation newActivation = null;
        if ( activation != null )
        {
            newActivation = new Activation();

            newActivation.setActiveByDefault( activation.isActiveByDefault() );

            ActivationFile af = activation.getFile();

            if ( af != null )
            {
                ActivationFile afNew = new ActivationFile();
                afNew.setExists( af.getExists() );
                afNew.setMissing( af.getMissing() );

                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 );
            }
        }

        return newActivation;
    }
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

    public void testShouldNotActivateReversalOfPresentSystemProperty() 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 );
       
        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.