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