Programmatically inject properties (and possibly overwrite existing
properties)

@param project
the current maven project
@param properties
the properties from input stream
554467
public static void inject(final MavenProject project, final InputStream properties) throws MojoFailureException {
    final Properties defaults = PropertyUtils.loadProperties(properties);
    final NarProperties nar = getInstance(project);
    nar.properties.putAll(defaults);
  }
389314
public void updateProperties(InputStream inputStream) {
        try {
            conf.load(inputStream);
            conf.putAll(System.getProperties());
        } catch (IOException e) {
            log.warn("Error loading system properties from input stream", e);
        }
    }
1243018
public void processProperties(Properties properties) {
        this.groupId = interpolateString(this.groupId, properties);
        this.artifactId = interpolateString(this.artifactId, properties);
        this.version = interpolateString(this.version, properties);
        this.description = interpolateString(this.description, properties);
        for (License l : this.getLicenses()) {
            l.setName(interpolateString(l.getName(), properties));
            l.setUrl(interpolateString(l.getUrl(), properties));
        }
        this.name = interpolateString(this.name, properties);
        this.projectURL = interpolateString(this.projectURL, properties);
        this.organization = interpolateString(this.organization, properties);
        this.parentGroupId = interpolateString(this.parentGroupId, properties);
        this.parentArtifactId = interpolateString(this.parentArtifactId, properties);
        this.parentVersion = interpolateString(this.parentVersion, properties);
    }
1042162
public void addDatabaseProperties(Map<String,Object> properties)
    {
        Map<String,Object> propRequest = this.getRequestProperties(this.getServletRequest(), false);
        if (propRequest != null)
        {   // Also move any application params up.
            for (String key : propRequest.keySet())
            {   // Move these params to the application
                if ((key.endsWith(BaseDatabase.DBSHARED_PARAM_SUFFIX))
            		|| (key.endsWith(BaseDatabase.DBUSER_PARAM_SUFFIX))
                    || (key.equals(DBConstants.MODE))
                    || (key.equals(DBConstants.SYSTEM_NAME)))
                		properties.put(key, propRequest.get(key));
            }
        }        
    }
1144493
static void generateProjectPropertiesFile(
            final String name,
            final File destfile,
            final boolean overwrite,
            final Properties properties,
            boolean addDefaultProps
    )
    {

        generateProjectPropertiesFile(name, destfile, overwrite, properties, false, null, addDefaultProps);
    }
1149024
public static File prepareCustomOvertureProperties(IVdmProject project,
			ILaunchConfiguration configuration) throws CoreException
	{
		List<String> properties = new Vector<String>();

		if (VdmDebugPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DBGP_ENABLE_EXPERIMENTAL_MODELCHECKER))
		{
			properties.add(getProbHomeProperty());
		}

		return writePropertyFile(project, "overture.properties", properties);
	}
680131
public void setProperties( Map<String,String> properties ) {
        Map<String,String> userProperties = systemSession.getUserProperties();
        if ( userProperties == null ) {
            userProperties = new HashMap<String,String>();
        }
        userProperties.putAll( properties );
        
        log.debug( "Session userProperties: {}", userProperties );
        
        systemSession = (MavenRepositorySystemSession)systemSession.setUserProperties( userProperties );
        
    }
232381
public void updatePropertyInMap(Map<String, CmsClientProperty> props) {

        CmsClientProperty prop = props.get(getName());
        if (prop == null) {
            prop = new CmsClientProperty(getName(), "", "");
            props.put(getName(), prop);
        }
        if (isStructureValue()) {
            prop.setStructureValue(getValue());
        } else {
            prop.setResourceValue(getValue());
        }
    }
1189392
public void addProperty( String property)
    {
    String candidate = StringUtils.trimToNull( property);
    if( candidate != null)
      {
      properties_.add( property);
      }
    }
169698
public PropertiesBuilder setModelProperties(PropertiesModel propertiesModel) {
        _modelProperties = propertiesModel != null ? propertiesModel.toProperties() : null;
        return this;
    }
779717
@Override
    public void setProperties(Properties properties) {
        if (this.env == null) {
            this.env = properties;
        } else {
            this.env.putAll(properties);
        }

        if (baseGateway != null) {
            baseGateway.setProperties(properties);
        }
    }
430445
private void setActiveProjectProperty(final String propertyName, final String propertyValue) {
        final Project activeProject = getProject();
        if (activeProject != null) {
            activeProject.setProperty(propertyName, propertyValue);
        }
    }
43388
public void setProperties( Map<String, Object> properties )
    {
        Introspector introspector = new Introspector( target.getClass(), new PropertyComparator() );
        for (Map.Entry<String,Object> property : properties.entrySet())
        {
            Method setter = introspector.getSetter( property.getKey() );
            if (setter != null) invoke( setter, property.getValue() );
        }
    }
1228442
@Override
    public void setProperties(Property[] newProperties) {
        // unregister the listeners from previous properties
        for (Property prop : properties) {
            prop.removePropertyChangeListener(this);
        }

        // replace the current properties
        properties.clear();
        properties.addAll(Arrays.asList(newProperties));

        // add listeners
        for (Property prop : properties) {
            prop.addPropertyChangeListener(this);
        }

        buildModel();
    }
1078464
public void setProjects(java.util.Collection<String> projects) {
        if (projects == null) {
            this.projects = null;
            return;
        }

        this.projects = new java.util.ArrayList<String>(projects);
    }
1072869
private void writeProperties() throws IOException
   {
      writeAttributeTypes("property_types", ProjectField.values());
      writeFields("property_values", m_projectFile.getProjectProperties(), ProjectField.values());
   }
1174988
private void addProjectProperties() throws MojoExecutionException
    {
        Properties projectProps = mavenProject.getProperties();
        
        projectProps.setProperty( PROPERTY_NAME_COMPANY, versionInfo.getCompanyName() );
        projectProps.setProperty( PROPERTY_NAME_COPYRIGHT, versionInfo.getCopyright() );

        projectProps.setProperty( PROPERTY_NAME_VERSION_MAJOR, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_MINOR, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_INCREMENTAL, "0" );
        projectProps.setProperty( PROPERTY_NAME_VERSION_BUILD, "0" );
        String version = mavenProject.getVersion();
        if ( version != null && version.length() > 0 )
        {
            ArtifactVersion artifactVersion = new DefaultArtifactVersion( version );
            if ( version.equals( artifactVersion.getQualifier() ) )
            {
                String msg = "Unable to parse the version string, please use standard maven version format.";
                getLog().error( msg );
                throw new MojoExecutionException( msg );
            }
            projectProps.setProperty( PROPERTY_NAME_VERSION_MAJOR, 
                    String.valueOf( artifactVersion.getMajorVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_MINOR, 
                    String.valueOf( artifactVersion.getMinorVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_INCREMENTAL, 
                    String.valueOf( artifactVersion.getIncrementalVersion() ) );
            projectProps.setProperty( PROPERTY_NAME_VERSION_BUILD, 
                    String.valueOf( artifactVersion.getBuildNumber() ) );
        }
        else
        {
            getLog().warn( "Missing version for project. Version parts will be set to 0" );
        }
    }