@Override public void accept(final Meecrowave.Builder configuration) { configuration.loadFromProperties(System.getProperties()); if (configuration.getProperties() == null) { configuration.setProperties(new Properties()); } configuration.getProperties().putAll(System.getProperties()); configuration .getProperties() .stringPropertyNames() .stream() .filter(k -> System.getProperty(k) == null) .forEach(k -> System.setProperty(k, configuration.getProperties().getProperty(k))); } }
private Meecrowave.Builder getConfig() { final Meecrowave.Builder config = new Meecrowave.Builder(); for (final Field field : MeecrowaveRunMojo.class.getDeclaredFields()) { if ("properties".equals(field.getName())) { continue; } try { final Field configField = Meecrowave.Builder.class.getDeclaredField(field.getName()); field.setAccessible(true); configField.setAccessible(true); final Object value = field.get(this); if (value != null) { configField.set(config, value); getLog().debug("using " + field.getName() + " = " + value); } } catch (final NoSuchFieldException nsfe) { // ignored } catch (final Exception e) { getLog().warn("can't initialize attribute " + field.getName()); } } config.loadFrom(meecrowaveProperties); if (properties != null) { config.getProperties().putAll(properties); } return config; } }
final Map<String, String> props = new HashMap<>(); if (config != null) { ofNullable(config.getProperties()).ifPresent(p -> p.stringPropertyNames().stream() .filter(k -> k.startsWith("jpa.property.")) .forEach(k -> props.put(k.substring("jpa.property.".length()), p.getProperty(k))));
securityProperties = ofNullable(builder.getProperties()).map(Properties::stringPropertyNames).orElse(emptySet()).stream() .filter(s -> s.startsWith("oauth2.cxf.rs.security.")) .collect(toMap(s -> s.substring("oauth2.cxf.".length()), s -> builder.getProperties().getProperty(s)));
map.putAll(asMap(builder.getProperties())); ofNullable(builder.getExtension(Cli.class).getConfiguration()).ifPresent(configuration -> { final File file = new File(configuration);
map.putAll(asMap(builder.getProperties())); ofNullable(builder.getExtension(Cli.class).getConfiguration()).ifPresent(configuration -> { final File file = new File(configuration);