@Override public String get(String key) { Properties userProperties = session.getUserProperties(); return userProperties.getProperty(key); }
@Override public void put(String key, String value) { Properties userProperties = session.getUserProperties(); userProperties.setProperty(key, value); } };
private FixedStringSearchInterpolator createCommandLinePropertiesInterpolator() { Properties commandLineProperties = System.getProperties(); final MavenSession session = getMavenSession(); if (session != null) { commandLineProperties = new Properties(); if (session.getSystemProperties() != null) { commandLineProperties.putAll(session.getSystemProperties()); } if (session.getUserProperties() != null) { commandLineProperties.putAll(session.getUserProperties()); } } PropertiesBasedValueSource cliProps = new PropertiesBasedValueSource( commandLineProperties ); return FixedStringSearchInterpolator.create( cliProps ); }
this.properties.putAll( session.getUserProperties() ); this.properties.putAll( session.getSystemProperties() );
private ProjectBuildingRequest injectSession( ProjectBuildingRequest request ) { MavenSession session = legacySupport.getSession(); if ( session != null ) { request.setRepositorySession( session.getRepositorySession() ); request.setSystemProperties( session.getSystemProperties() ); if ( request.getUserProperties().isEmpty() ) { request.setUserProperties( session.getUserProperties() ); } MavenExecutionRequest req = session.getRequest(); if ( req != null ) { request.setRemoteRepositories( req.getRemoteRepositories() ); } } else { Properties props = new Properties(); EnvironmentUtils.addEnvVars( props ); props.putAll( System.getProperties() ); request.setSystemProperties( props ); } return request; }
automatorRemoteAndroidTestRunner.setTestClassOrMethods( parsedTestClassOrMethods ); automatorRemoteAndroidTestRunner.setNoHup( parsedNoHup ); automatorRemoteAndroidTestRunner.setUserProperties( session.getUserProperties(), parsedPropertiesKeyPrefix );
private boolean disableLifecycleParticipation(MavenSession session) { // command line property to disable Tycho lifecycle participant if ("maven".equals(session.getUserProperties().get("tycho.mode"))) { return true; } if (session.getUserProperties().containsKey("m2e.version")) { return true; } return false; }
protected boolean alternateLifecycleProvidingPrimaryArtifact() { String alternateLifecycleProvidingPrimaryArtifact = session.getUserProperties().getProperty(TakariLifecycleFlags.ALTERNATE_LIFECYCLE_PROVIDING_PRIMARY_ARTIFACT); if(alternateLifecycleProvidingPrimaryArtifact != null && alternateLifecycleProvidingPrimaryArtifact.equals("true")) { return true; } return false; } }
protected boolean alternateLifecycleProvidingPrimaryArtifact() { String alternateLifecycleProvidingPrimaryArtifact = session.getUserProperties().getProperty(TakariLifecycleFlags.ALTERNATE_LIFECYCLE_PROVIDING_PRIMARY_ARTIFACT); if(alternateLifecycleProvidingPrimaryArtifact != null && alternateLifecycleProvidingPrimaryArtifact.equals("true")) { return true; } return false; } }
protected String getProperty(String key) { String value = session.getUserProperties().getProperty(key); if (value == null) { value = project.getProperties().getProperty(key); } return value; }
public static boolean isDebugEnabled(MavenSession session, MavenProject project) { String config = session.getUserProperties().getProperty("tycho.debug.resolver"); return config != null && (config.trim().equals(project.getArtifactId()) || "true".equals(config.trim())); } }
private boolean isProfiling(MavenSession session) { String value = session.getUserProperties().getProperty(PROP_PROFILING); if (value == null) { value = session.getSystemProperties().getProperty(PROP_PROFILING); } return Boolean.parseBoolean(value); }
private Properties getUserProperties() { return getSession().getUserProperties(); }
/** * Inspects the session's user and project properties for the {@link * DetectMojo#CLASSIFIER_WITH_LIKES_PROPERTY} and separates the property into a list. */ private static List<String> getClassifierWithLikes(MavenSession session) { // Check to see if the project defined the final Properties props = new Properties(); props.putAll(session.getUserProperties()); props.putAll(session.getCurrentProject().getProperties()); return DetectMojo.getClassifierWithLikes( props.getProperty(DetectMojo.CLASSIFIER_WITH_LIKES_PROPERTY)); }
/** * Inspects the session's user and project properties for the {@link * DetectMojo#CLASSIFIER_WITH_LIKES_PROPERTY} and separates the property into a list. */ private static List<String> getClassifierWithLikes(MavenSession session) { // Check to see if the project defined the final Properties props = new Properties(); props.putAll(session.getUserProperties()); props.putAll(session.getCurrentProject().getProperties()); return DetectMojo.getClassifierWithLikes( props.getProperty(DetectMojo.CLASSIFIER_WITH_LIKES_PROPERTY)); }
public static String getExecutionProperty(final ExecutionEvent event, final String property, final String def) { MavenSession mavenSession = event.getSession(); Properties systemProperties = mavenSession.getSystemProperties(); Properties userProperties = mavenSession.getUserProperties(); Properties projectProperties = mavenSession.getTopLevelProject() == null ? null : mavenSession.getTopLevelProject().getProperties(); String output = userProperties.getProperty(property); output = output == null ? projectProperties != null ? projectProperties.getProperty(property) : null : output; output = output == null ? systemProperties.getProperty(property) : output; return output == null ? def : output; } }
private FixedStringSearchInterpolator createCommandLinePropertiesInterpolator() { Properties commandLineProperties = System.getProperties(); final MavenSession session = getMavenSession(); if ( session != null ) { commandLineProperties = new Properties(); commandLineProperties.putAll( session.getSystemProperties() ); commandLineProperties.putAll( session.getUserProperties() ); } PropertiesBasedValueSource cliProps = new PropertiesBasedValueSource( commandLineProperties ); return FixedStringSearchInterpolator.create( cliProps ); }
public Map<String, String> createGlobalProperties() { Map<String, String> p = new HashMap<>(); MavenUtils.putAll(session.getCurrentProject().getProperties(), p); MavenUtils.putAll(envProps, p); MavenUtils.putAll(session.getSystemProperties(), p); MavenUtils.putAll(session.getUserProperties(), p); p.putAll(propertyDecryptor.decryptProperties(p)); return p; }
private Map<String, String> getUserSystemProperties() { return new UserPropertiesBuilder(project.getBuild().getDirectory(), getLog()) .withSystemPropertyVariables(systemPropertyVariables) .withDynamicPorts(dynamicPorts) .withUserProperties(session != null ? session.getUserProperties() : null) .build(); }
private ModelBuildingRequest createModelBuildingRequest( File pomFile ) { FlattenModelResolver resolver = new FlattenModelResolver( this.localRepository, this.artifactFactory, this.dependencyResolver, this.session.getProjectBuildingRequest(), this.session.getAllProjects() ); Properties userProperties = this.session.getUserProperties(); List<String> activeProfiles = this.session.getRequest().getActiveProfiles(); // @formatter:off ModelBuildingRequest buildingRequest = new DefaultModelBuildingRequest().setUserProperties( userProperties ).setSystemProperties( System.getProperties() ).setPomFile( pomFile ).setModelResolver( resolver ).setActiveProfileIds( activeProfiles ); // @formatter:on return buildingRequest; }