Package org.apache.maven.model

Examples of org.apache.maven.model.Activation


    public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
    {
        boolean active = false;

        Activation activation = profile.getActivation();

        if ( activation != null )
        {
            String jdk = activation.getJdk();

            if ( jdk != null )
            {
                String version = context.getSystemProperties().get( "java.version" );

                if ( version == null || version.length() <= 0 )
                {
                    problems.add( Severity.ERROR, "Failed to determine Java version for profile " + profile.getId(),
                                  activation.getLocation( "jdk" ), null );
                    return false;
                }

                if ( jdk.startsWith( "!" ) )
                {
View Full Code Here


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

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

        String jdk = activation.getJdk();

        // null case is covered by canDetermineActivation(), so we can do a straight startsWith() here.
        if ( jdk.startsWith( "[" ) || jdk.startsWith( "(" ) )
        {
            try
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

    }

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

        return false;
    }

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

        return this;
    }

    public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
    {
        Activation activation = profile.getActivation();

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

        ActivationFile file = activation.getFile();

        if ( file == null )
        {
            return false;
        }
View Full Code Here

        profile = new Profile();
        profile.setId(MAIN_PROFILE);
        pom.addProfile(profile);
      }
      if (profile.getActivation() == null)
        profile.setActivation(new Activation());
      profile.getActivation().setActiveByDefault(true);
      coreFacet.setModel(pom);

      return true;
    }
View Full Code Here

  /**
   * @return A map of the profile activations that were replaced.
   */
  private Map<String, Activation> setBlacklistProfilesToInactive(final Model pom) {
    final Map<String, Activation> profileActivationMap = new HashMap<String, Activation>(pom.getProfiles().size());
    final Activation inactive = new Activation();
    inactive.setActiveByDefault(false);

    for (final Profile profile : pom.getProfiles()) {
      if (ArtifactVault.getBlacklistProfiles().contains(profile.getId())) {
        profileActivationMap.put(profile.getId(), profile.getActivation());
        profile.setActivation(inactive);
View Full Code Here

  /**
   * @return A map of the profile activations that were replaced.
   */
  private Map<String, Activation> setBlacklistProfilesToInactive(final Model pom) {
    final Map<String, Activation> profileActivationMap = new HashMap<String, Activation>(pom.getProfiles().size());
    final Activation inactive = new Activation();
    inactive.setActiveByDefault(false);

    for (final Profile profile : pom.getProfiles()) {
      if (ArtifactVault.getBlacklistProfiles().contains(profile.getId())) {
        profileActivationMap.put(profile.getId(), profile.getActivation());
        profile.setActivation(inactive);
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.