code: public Map<String, String> readPropertiesFromActiveProfiles( final String prefix,
                                                                   final String... properties ) {
          if (settings == null) {
              console.debug("No maven setting injected");
              return Collections.emptyMap();
          }
  
          final List<String> activeProfilesList = settings.getActiveProfiles();
          if (activeProfilesList.isEmpty()) {
              console.debug("No active profiles found");
              return Collections.emptyMap();
          }
  
          final Map<String, String> map = new HashMap<String, String>();
          final Set<String> activeProfiles = new HashSet<String>(activeProfilesList);
  
          // Iterate over all active profiles in order
          for (final Profile profile : settings.getProfiles()) {
              // Check if the profile is active
              final String profileId = profile.getId();
              if (activeProfiles.contains(profileId)) {
                  console.debug("Trying active profile " + profileId);
                  for (final String property : properties) {
                      final String propKey = prefix != null ? prefix + property : property;
                      final String value = profile.getProperties().getProperty(propKey);
                      if (value != null) {
                          console.debug("Found property " + property + " in profile " + profileId);
                          map.put(property, value);
                      }
                  }
              }
          }
  
          return map;
      }
docs: Read properties from the active profiles.
  
  Goes through all active profiles (in the order the
  profiles are defined in settings.xml) and extracts
  the desired properties (if present). The prefix is
  used when looking up properties in the profile but
  not in the returned map.
  
  @param prefix The prefix to use or null if no prefix should be used
  @param properties The properties to read
  
  @return A map containing the values for the properties that were found