Search in sources :

Example 1 with ActivationProperty

use of org.apache.maven.model.ActivationProperty in project spring-cloud-function by spring-cloud.

the class MavenSettings method createModelActivation.

private org.apache.maven.model.Activation createModelActivation(Activation activation) {
    org.apache.maven.model.Activation modelActivation = new org.apache.maven.model.Activation();
    modelActivation.setActiveByDefault(activation.isActiveByDefault());
    if (activation.getFile() != null) {
        ActivationFile activationFile = new ActivationFile();
        activationFile.setExists(activation.getFile().getExists());
        activationFile.setMissing(activation.getFile().getMissing());
        modelActivation.setFile(activationFile);
    }
    modelActivation.setJdk(activation.getJdk());
    if (activation.getOs() != null) {
        ActivationOS os = new ActivationOS();
        os.setArch(activation.getOs().getArch());
        os.setFamily(activation.getOs().getFamily());
        os.setName(activation.getOs().getName());
        os.setVersion(activation.getOs().getVersion());
        modelActivation.setOs(os);
    }
    if (activation.getProperty() != null) {
        ActivationProperty property = new ActivationProperty();
        property.setName(activation.getProperty().getName());
        property.setValue(activation.getProperty().getValue());
        modelActivation.setProperty(property);
    }
    return modelActivation;
}
Also used : ActivationFile(org.apache.maven.model.ActivationFile) ActivationOS(org.apache.maven.model.ActivationOS) Activation(org.apache.maven.settings.Activation) ActivationProperty(org.apache.maven.model.ActivationProperty)

Example 2 with ActivationProperty

use of org.apache.maven.model.ActivationProperty in project spring-boot by spring-projects.

the class MavenSettings method createModelActivation.

private org.apache.maven.model.Activation createModelActivation(Activation activation) {
    org.apache.maven.model.Activation modelActivation = new org.apache.maven.model.Activation();
    modelActivation.setActiveByDefault(activation.isActiveByDefault());
    if (activation.getFile() != null) {
        ActivationFile activationFile = new ActivationFile();
        activationFile.setExists(activation.getFile().getExists());
        activationFile.setMissing(activation.getFile().getMissing());
        modelActivation.setFile(activationFile);
    }
    modelActivation.setJdk(activation.getJdk());
    if (activation.getOs() != null) {
        ActivationOS os = new ActivationOS();
        os.setArch(activation.getOs().getArch());
        os.setFamily(activation.getOs().getFamily());
        os.setName(activation.getOs().getName());
        os.setVersion(activation.getOs().getVersion());
        modelActivation.setOs(os);
    }
    if (activation.getProperty() != null) {
        ActivationProperty property = new ActivationProperty();
        property.setName(activation.getProperty().getName());
        property.setValue(activation.getProperty().getValue());
        modelActivation.setProperty(property);
    }
    return modelActivation;
}
Also used : ActivationFile(org.apache.maven.model.ActivationFile) ActivationOS(org.apache.maven.model.ActivationOS) Activation(org.apache.maven.settings.Activation) ActivationProperty(org.apache.maven.model.ActivationProperty)

Example 3 with ActivationProperty

use of org.apache.maven.model.ActivationProperty in project che by eclipse.

the class MavenModelUtil method convertToMavenActivationProperty.

private static ActivationProperty convertToMavenActivationProperty(MavenActivationProperty property) {
    if (property != null) {
        ActivationProperty result = new ActivationProperty();
        result.setName(property.getName());
        result.setValue(property.getValue());
        return result;
    }
    return null;
}
Also used : ActivationProperty(org.apache.maven.model.ActivationProperty) MavenActivationProperty(org.eclipse.che.maven.data.MavenActivationProperty)

Example 4 with ActivationProperty

use of org.apache.maven.model.ActivationProperty in project pom-manipulation-ext by release-engineering.

the class Project method updateProfiles.

public void updateProfiles(List<Profile> remoteProfiles) {
    final List<Profile> profiles = model.getProfiles();
    if (!remoteProfiles.isEmpty()) {
        for (Profile profile : remoteProfiles) {
            final Iterator<Profile> i = profiles.iterator();
            while (i.hasNext()) {
                final Profile p = i.next();
                if (profile.getId().equals(p.getId())) {
                    logger.debug("Removing local profile {} ", p);
                    i.remove();
                // Don't break out of the loop so we can check for active profiles
                }
                // of activeByDefault. Therefore replace the activation.
                if (p.getActivation() != null && p.getActivation().isActiveByDefault()) {
                    logger.warn("Profile {} is activeByDefault", p);
                    final Activation replacement = new Activation();
                    final ActivationProperty replacementProp = new ActivationProperty();
                    replacementProp.setName("!disableProfileActivation");
                    replacement.setProperty(replacementProp);
                    p.setActivation(replacement);
                }
            }
            logger.debug("Adding profile {}", profile);
            profiles.add(profile);
        }
        logger.info("Clearing resolved profile caches to trigger rescanning...");
        resolvedProfileDependencies = null;
        allResolvedProfileDependencies = null;
        resolvedProfileManagedDependencies = null;
        resolvedProfileManagedPlugins = null;
        resolvedProfilePlugins = null;
    }
}
Also used : Activation(org.apache.maven.model.Activation) ActivationProperty(org.apache.maven.model.ActivationProperty) Profile(org.apache.maven.model.Profile)

Example 5 with ActivationProperty

use of org.apache.maven.model.ActivationProperty in project tesb-studio-se by Talend.

the class CreateMavenBundlePom method addProfileForCloud.

/**
 * skip depoly phase in publich to cloud in parent pom, enable in nexus.
 */
private Profile addProfileForCloud() {
    Profile deployCloudProfile = new Profile();
    deployCloudProfile.setId("deploy-cloud");
    Activation deployCloudActivation = new Activation();
    ActivationProperty activationProperty = new ActivationProperty();
    activationProperty.setName("!altDeploymentRepository");
    deployCloudActivation.setProperty(activationProperty);
    deployCloudProfile.setActivation(deployCloudActivation);
    deployCloudProfile.setBuild(new Build());
    deployCloudProfile.getBuild().addPlugin(addSkipDeployFeatureMavenPlugin());
    return deployCloudProfile;
}
Also used : Build(org.apache.maven.model.Build) Activation(org.apache.maven.model.Activation) ActivationProperty(org.apache.maven.model.ActivationProperty) Profile(org.apache.maven.model.Profile)

Aggregations

ActivationProperty (org.apache.maven.model.ActivationProperty)6 Activation (org.apache.maven.model.Activation)3 Profile (org.apache.maven.model.Profile)3 ActivationFile (org.apache.maven.model.ActivationFile)2 ActivationOS (org.apache.maven.model.ActivationOS)2 Build (org.apache.maven.model.Build)2 Activation (org.apache.maven.settings.Activation)2 MavenActivationProperty (org.eclipse.che.maven.data.MavenActivationProperty)1