Refine search
if ( activation.isActiveByDefault() != false ) serializer.startTag( NAMESPACE, "activeByDefault" ).text( String.valueOf( activation.isActiveByDefault() ) ).endTag( NAMESPACE, "activeByDefault" ); if ( activation.getJdk() != null ) serializer.startTag( NAMESPACE, "jdk" ).text( activation.getJdk() ).endTag( NAMESPACE, "jdk" ); if ( activation.getOs() != null ) writeActivationOS( (ActivationOS) activation.getOs(), "os", serializer ); if ( activation.getProperty() != null ) writeActivationProperty( (ActivationProperty) activation.getProperty(), "property", serializer ); if ( activation.getFile() != null ) writeActivationFile( (ActivationFile) activation.getFile(), "file", serializer );
public static Activation cloneActivation( Activation src ) { if ( src == null ) { return null; } Activation result = new Activation(); result.setActiveByDefault( src.isActiveByDefault() ); result.setFile( cloneActivationFile( src.getFile() ) ); result.setJdk( src.getJdk() ); result.setOs( cloneActivationOs( src.getOs() ) ); result.setProperty( cloneActivationProperty( src.getProperty() ) ); return result; }
@Override public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems ) Activation activation = profile.getActivation(); String jdk = activation.getJdk(); .setMessage( "Failed to determine Java version for profile " + profile.getId() ) .setLocation( activation.getLocation( "jdk" ) ) ); return false;
for( Profile profile: profiles ){ p.print( "profile" ); if (profile.getId() != null ){ p.append( " '" ).append( profile.getId() ).append( "'" ); p.printStartBlock(); p.println(); if ( profile.getActivation() != null ) Activation activation = profile.getActivation(); p.printStartBlock( "activation" ); ActivationProperty prop = activation.getProperty(); if ( prop != null ) ActivationFile file = activation.getFile(); if ( file != null ) String jdk = activation.getJdk(); if ( jdk != null ) if ( activation.isActiveByDefault() ) ActivationOS os = activation.getOs(); if ( os != null )
Activation activation = new Activation(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) activation.setActiveByDefault( getBooleanValue( interpolatedTrimmed( parser.nextText(), "activeByDefault" ), "activeByDefault", parser, "false" ) ); activation.setJdk( interpolatedTrimmed( parser.nextText(), "jdk" ) ); activation.setOs( parseActivationOS( parser, strict ) ); activation.setProperty( parseActivationProperty( parser, strict ) ); activation.setFile( parseActivationFile( parser, strict ) );
public static Profile convertFromProfileXmlProfile( org.apache.maven.profiles.Profile profileXmlProfile ) Profile profile = new Profile(); profile.setId( profileXmlProfile.getId() ); profile.setSource( "profiles.xml" ); Activation activation = new Activation(); activation.setActiveByDefault( profileActivation.isActiveByDefault() ); activation.setJdk( profileActivation.getJdk() ); prop.setValue( profileProp.getValue() ); activation.setProperty( prop ); os.setVersion( profileOs.getVersion() ); activation.setOs( os ); file.setMissing( profileFile.getMissing() ); activation.setFile( file );
profile.setId( modelProfile.getId() ); org.apache.maven.model.Activation modelActivation = modelProfile.getActivation(); activation.setActiveByDefault( modelActivation.isActiveByDefault() ); activation.setJdk( modelActivation.getJdk() ); org.apache.maven.model.ActivationProperty modelProp = modelActivation.getProperty(); org.apache.maven.model.ActivationOS modelOs = modelActivation.getOs(); ActivationFile modelFile = modelActivation.getFile(); profile.setProperties( modelProfile.getProperties() ); List<org.apache.maven.model.Repository> repos = modelProfile.getRepositories();
if ("_tmp-site".equals(p.getId())) { profile = p; Activation activation = new Activation(); activation.setActiveByDefault(true); profile = new Profile(); profile.setActivation(activation); profile.setId("_tmp-site");
public boolean isActive( Profile profile ) throws ProfileActivationException Activation activation = profile.getActivation(); ActivationProperty property = activation.getProperty(); + profile.getId() + "'" );
private void writeProfiles() throws IOException { if (model.getProfiles() != null) { for (Profile profile : model.getProfiles()) { out.write(" " + "profile(\"" + profile.getId() + "\")" + br); Activation activation = profile.getActivation(); if (activation != null) { out.write(" " + " " + ".activeByDefault(" + activation.isActiveByDefault() + ")" + br); if (activation.getJdk() != null) { out.write(" " + " " + ".activeByDefault(" + activation.isActiveByDefault() + ")" + br); if (activation.getProperty() != null) { String propertyValue = activation.getProperty().getValue() == null ? "null" : "\"" + activation.getProperty().getValue() + "\""; out.write(" " + " " + ".activeForPropertyValue(\"" + activation.getProperty().getName() + "\"," + propertyValue + ")" + br); if (activation.getFile() != null) { String exists = activation.getFile().getExists() == null ? "null" : "\"" + activation.getFile().getExists() + "\""; String missing = activation.getFile().getMissing() == null ? "null" : "\"" + activation.getFile().getMissing() + "\""; out.write(" " + " " + ".activeForFile(" + exists + "," + missing + ")" + br); if (profile.getBuild() != null) { out.write(" " + " " + ".build(" + br); out.write(" " + " " + "profileBuild()" + br);
while (it.hasNext()) { org.apache.maven.model.Profile profile = (org.apache.maven.model.Profile) it.next(); if (PROFILE_PUBLIC.equals(profile.getId())) { publicProfile = profile; break; publicProfile = new org.apache.maven.model.Profile(); publicProfile.setId(PROFILE_PUBLIC); Activation act = new Activation(); ActivationProperty prop = new ActivationProperty(); prop.setName(PROPERTY_PROFILE); prop.setValue("true"); //NOI18N act.setProperty(prop); publicProfile.setActivation(act); publicProfile.setBuild(new BuildBase());
public void addProfile( Profile profile ) { String profileId = profile.getId(); Profile existing = profilesById.get( profileId ); if ( existing != null ) { logger.warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ") with new instance from source: " + profile.getSource() ); } profilesById.put( profile.getId(), profile ); Activation activation = profile.getActivation(); if ( activation != null && activation.isActiveByDefault() ) { activateAsDefault( profileId ); } }
if ( profile.getId().equals( p.getId() ) ) if ( p.getActivation() != null && p.getActivation().isActiveByDefault() ) final Activation replacement = new Activation(); final ActivationProperty replacementProp = new ActivationProperty(); replacementProp.setName( "!disableProfileActivation" ); replacement.setProperty( replacementProp ); p.setActivation( replacement );
@Override public List<Profile> getActiveProfiles(Collection<Profile> profiles, ProfileActivationContext context, ModelProblemCollector problems) { List<Profile> activeProfiles = new ArrayList<Profile>(); for (Profile p : profiles) { String id = p.getId(); if (p.getId() != null && context.getActiveProfileIds().contains(id) && !context.getInactiveProfileIds().contains(id)) { activeProfiles.add(p); continue; } if (p.getActivation() != null && p.getActivation().isActiveByDefault() && !context.getInactiveProfileIds().contains(p.getId())) { activeProfiles.add(p); continue; } for (ProfileActivator activator : activators) { if (activator.isActive(p, context, problems)) { activeProfiles.add(p); break; } } } return activeProfiles; }
public boolean isActive( Profile profile ) throws ProfileActivationException Activation activation = profile.getActivation(); String jdk = activation.getJdk(); throw new ProfileActivationException( "Invalid JDK version in profile '" + profile.getId() + "': " + e.getMessage() );
@Override public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems ) Activation activation = profile.getActivation(); ActivationFile file = activation.getFile(); .setMessage( "Failed to interpolate file location " + path + " for profile " + profile.getId() + ": " + e.getMessage() ) .setLocation( file.getLocation( missing ? "missing" : "exists" ) )
@Override public boolean install() { if (super.install()) { // Set main profile to be active by default final MavenFacet coreFacet = getProject().getFacet(MavenFacet.class); final Model pom = coreFacet.getModel(); Profile profile = MavenModelUtil.getProfileById(MAIN_PROFILE, pom.getProfiles()); if (profile == null) { 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; } else { return false; } } }
/** * @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); } } return profileActivationMap; }
public boolean canDetermineActivation( Profile profile ) { Activation activation = profile.getActivation(); return activation != null && activation.getOs() != null; }
@Override public boolean presentInConfig( Profile profile, ProfileActivationContext context, ModelProblemCollector problems ) { Activation activation = profile.getActivation(); if ( activation == null ) { return false; } ActivationFile file = activation.getFile(); if ( file == null ) { return false; } return true; }