valueSources.add( new BuildTimestampValueSource( config.getBuildStartTime(), timestampFormat ) ); valueSources.add( modelValueSource1 ); valueSources.add( new MapBasedValueSource( config.getUserProperties() ) ); valueSources.add( new MapBasedValueSource( modelProperties ) ); valueSources.add( new MapBasedValueSource( config.getExecutionProperties() ) ); valueSources.add( new AbstractValueSource( false )
valueSources.add( new BuildTimestampValueSource( config.getBuildStartTime(), timestampFormat ) ); valueSources.add( modelValueSource1 ); valueSources.add( new MapBasedValueSource( config.getUserProperties() ) ); valueSources.add( new MapBasedValueSource( modelProperties ) ); valueSources.add( new MapBasedValueSource( config.getExecutionProperties() ) ); valueSources.add( new AbstractValueSource( false )
valueSources.add( new MapBasedValueSource( config.getUserProperties() ) ); valueSources.add( new MapBasedValueSource( modelProperties ) ); valueSources.add( new MapBasedValueSource( config.getSystemProperties() ) );
interpolator.addValueSource( new MapBasedValueSource( context.getProjectProperties() ) ); interpolator.addValueSource( new MapBasedValueSource( context.getUserProperties() ) ); interpolator.addValueSource( new MapBasedValueSource( context.getSystemProperties() ) );
interpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) );
ssi.addValueSource( new MapBasedValueSource( request.getUserProperties() ) ); ssi.addValueSource( new MapBasedValueSource( model.getProperties() ) ); ssi.addValueSource( new MapBasedValueSource( request.getSystemProperties() ) );
interpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) );
public void contextualize( Context context ) throws ContextException { regexBasedInterpolator.addValueSource( new MapBasedValueSource( context.getContextData() ) ); // FIXME: bad, everything should come from Plexus context regexBasedInterpolator.addValueSource( new MapBasedValueSource( System.getenv() ) ); // FIXME: bad, everything should come from Plexus context regexBasedInterpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) ); }
public List<ValueSource> createValueSources(Model model, File projectDir, ModelBuildingRequest request, ModelProblemCollector collector) { List<ValueSource> sources = new ArrayList<>(); sources.addAll(super.createValueSources(model, projectDir, request, collector)); sources.add(new PropertiesBasedValueSource(System.getProperties())); sources.add(new MapBasedValueSource(project.getProperties())); return sources; } }
public static Interpolator getInterpolator(final Map<String, Object> context) { // interpolate what we have final Interpolator interpolator = new RegexBasedInterpolator(); if (context != null) { interpolator.addValueSource(new MapBasedValueSource(context)); } return interpolator; }
public static Interpolator getInterpolator( final Map<String, Object> context ) { // interpolate what we have final Interpolator interpolator = new RegexBasedInterpolator(); if ( context != null ) { interpolator.addValueSource( new MapBasedValueSource( context ) ); } return interpolator; }
private Map<String, String> resolve(final Map<String, String> source) { Map<String, String> result = Maps.newHashMapWithExpectedSize(source.size()); Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(source)); for (Entry<String, String> entry : source.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (value == null) { log.warn("Ignoring null property: {}", key); continue; } // skip unless value contains an expression if (value.contains(StringSearchInterpolator.DEFAULT_START_EXPR)) { try { value = interpolator.interpolate(value); log.trace("Resolved: {} -> '{}'", key, value); } catch (InterpolationException e) { log.warn("Failed to interpolate: {}, using original value: {}", key, value); } } result.put(key, value); } return result; } }
@Nonnull private String interpolate(@Nonnull final String str) throws IOException, InterpolationException { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(this.getProject().getProperties())); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); return interpolator.interpolate(str); }
/** * Helper to interpolate given input. */ public static String interpolate(final String input) throws InterpolationException { StringSearchInterpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(tokens.get())); return interpolator.interpolate(input); }
interpolator.addValueSource( new MapBasedValueSource( containerProperties ) ); interpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) ); interpolator.addValueSource( new MapBasedValueSource( context ) );
private void interpolate() throws Exception { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(properties)); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); for (Entry<String, String> entry : properties.entrySet()) { properties.put(entry.getKey(), interpolator.interpolate(entry.getValue())); } }
private void interpolate() throws Exception { Interpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(properties)); interpolator.addValueSource(new MapBasedValueSource(System.getProperties())); interpolator.addValueSource(new EnvarBasedValueSource()); for (Entry<String, String> entry : properties.entrySet()) { properties.put(entry.getKey(), interpolator.interpolate(entry.getValue())); } }
MapBasedValueSource getValueSource(GitRepository repository) throws GitRepositoryException { GitTagDescription description = repository.describe(); String abbrevId = repository.getAbbreviatedCommitId(); String shaId = repository.getHeadCommit().getId(); String describe = description.toString(); boolean isDirty = repository.isDirty(dirtyIgnoreUntracked); if (isDirty && dirtyFlag != null) { abbrevId += dirtyFlag; shaId += dirtyFlag; describe += dirtyFlag; } HashMap<String, String> values = new HashMap<>(); values.put("BRANCH", repository.getBranch()); values.put("CLASS_NAME", className); values.put("COMMIT_ABBREV", abbrevId); values.put("COMMIT_SHA", shaId); values.put("DESCRIBE", describe); values.put("DIRTY", Boolean.toString(isDirty)); values.put("PACKAGE_NAME", packageName); values.put("TAG_NAME", description.getNextTagName()); values.put("TIMESTAMP", new SimpleDateFormat(dateFormat).format(new Date())); values.put("VERSION", project.getVersion()); String version = VersionHelper.getVersion(); if (version != null) { values.put("MAVANAGAIATA_VERSION", version); } return new MapBasedValueSource(values); }
interpolator.addValueSource( new MapBasedValueSource( containerProperties ) ); interpolator.addValueSource( new MapBasedValueSource( System.getProperties() ) ); interpolator.addValueSource( new MapBasedValueSource( environment ) );
valueSources.add( new MapBasedValueSource( project.getProperties() ) ); valueSources.add( new MapBasedValueSource( System.getProperties() ) );