/** * The Constructor. * * @param theContext {@link MavenSession} * @param thePathTranslator {@link PathTranslator} * @param theProject {@link MavenProject} * @param theExecution {@link MojoExecution} */ public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator, MavenProject theProject, MojoExecution theExecution ) { super( theContext, theExecution, thePathTranslator, null, theProject, theContext.getExecutionProperties() ); }
/** * Gets the list of watchers from the given MavenSession. * * @param session the Maven session * @return the list of watcher, empty if none. Modifying the resulting list, updates the stored list. */ static synchronized List<Watcher> get(MavenSession session) { List<Watcher> watchers = (List<Watcher>) session.getExecutionProperties().get(WATCHERS_KEY); if (watchers == null) { watchers = new ArrayList<>(); session.getExecutionProperties().put(WATCHERS_KEY, watchers); } return watchers; }
private Date getSessionTimestamp() { Date timestamp; String value = session.getExecutionProperties().getProperty(REACTOR_BUILD_TIMESTAMP_PROPERTY); if (value != null) { timestamp = new Date(Long.parseLong(value)); } else { timestamp = new Date(); session.getExecutionProperties().setProperty(REACTOR_BUILD_TIMESTAMP_PROPERTY, Long.toString(timestamp.getTime())); } return timestamp; }
public Object lookup(final Object key) { // First try execution properties, should include system Object value = session.getExecutionProperties().get(key); // Else try ourselves if (value == null) { value = super.get(key); } // Then try defaults (from adapter, not from properties, which is not used) if (value == null && GroovyMavenProjectAdapter.this.defaults != null) { value = GroovyMavenProjectAdapter.this.defaults.get(key); } return value; }
public Object lookup(final Object key) { // First try ourself (pom + custom) Object value = super.get(key); // Then try execution (system) properties if (value == null) { value = session.getExecutionProperties().get(key); } // Then try defaults (from adapter, not from properties, which is not used) if (value == null && GroovyMavenProjectAdapter.this.defaults != null) { value = GroovyMavenProjectAdapter.this.defaults.get(key); } return value; }
protected void processSystemProperties(final boolean setInSystem) { if (this.systemProperties == null) { this.systemProperties = new Properties(); } this.originalSystemProperties = (Properties) System.getProperties().clone(); // We used to take all of our system properties and dump them in with the // user specified properties for SUREFIRE-121, causing SUREFIRE-491. // Not gonna do THAT any more... but I'm leaving this code here in case // we need it later when we try to fix SUREFIRE-121 again. // Get the properties from the MavenSession instance to make embedded use // work correctly final Properties userSpecifiedProperties = (Properties) this.session.getExecutionProperties().clone(); userSpecifiedProperties.putAll(this.systemProperties); // systemProperties = userSpecifiedProperties; this.systemProperties.setProperty("basedir", this.basedir.getAbsolutePath()); this.systemProperties.setProperty("user.dir", this.workingDirectory.getAbsolutePath()); // DUNS, use access method rather than "localRepository" field. this.systemProperties.setProperty("localRepository", getLocalRepository().getBasedir()); if (setInSystem) { // Add all system properties configured by the user for (final Object o : this.systemProperties.keySet()) { final String key = (String) o; final String value = this.systemProperties.getProperty(key); System.setProperty(key, value); } } }
for (Map.Entry<Object, Object> property : session.getExecutionProperties().entrySet()) {
public VersionsExpressionEvaluator( MavenSession mavenSession, PathTranslator pathTranslator, MavenProject mavenProject ) { super( mavenSession, new MojoExecution( new MojoDescriptor() ), pathTranslator, null, mavenProject, mavenSession.getExecutionProperties() ); } }
public VersionsExpressionEvaluator( MavenSession mavenSession, PathTranslator pathTranslator, MavenProject mavenProject ) { super( mavenSession, new MojoExecution( new MojoDescriptor() ), pathTranslator, null, mavenProject, mavenSession.getExecutionProperties() ); } }
/** * The Constructor. * * @param context the the context * @param pathTranslator the the path translator * @param project the the project */ public TeaCompilerExpressionEvaluator( MavenSession context, PathTranslator pathTranslator, MavenProject project ) { super( context, new MojoExecution( new MojoDescriptor() ), pathTranslator, null, project, context.getExecutionProperties() ); } }
/** * This constructor is kept for backward compatibility. * * @param theContext {@link MavenSession} * @param thePathTranslator {@link PathTranslator} * @param theProject {@link MavenProject} * * @deprecated Will be removed with 2.0 */ public EnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator, MavenProject theProject ) { super( theContext, new MojoExecution( new MojoDescriptor() ), thePathTranslator, null, theProject, theContext.getExecutionProperties() ); } }
private static FixedStringSearchInterpolator executionPropertiesInterpolator( AssemblerConfigurationSource configSource ) { MavenSession session; if ( configSource != null ) { session = configSource.getMavenSession(); if ( session != null ) { Properties userProperties = session.getExecutionProperties(); // this is added twice.... if ( userProperties != null ) { return FixedStringSearchInterpolator.create( new PropertiesBasedValueSource( userProperties ) ); } } } return FixedStringSearchInterpolator.empty(); }
properties.setProperty("moduleVersion", mavenProject.getVersion()); properties.setProperty("version", mavenProject.getVersion()); mavenSession.getExecutionProperties().putAll(properties);
@Override protected void doExecute() throws MojoExecutionException, MojoFailureException { trackFirstRunIfNeeded(); getGoogleTracker().track(GoogleAmpsTracker.CREATE_PLUGIN); String pid = getProductId(); Product ctx = getProductContexts().get(pid); AbstractProductHandler handler = createProductHandler(pid); getLog().info("determining latest stable product version..."); String stableVersion = getStableProductVersion(handler,ctx); if (StringUtils.isNotBlank(stableVersion)) { getLog().info("using latest stable product version: " + stableVersion); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "Version", stableVersion); } getLog().info("determining latest stable data version..."); String stableDataVersion = getStableDataVersion(handler,ctx); if (StringUtils.isNotBlank(stableDataVersion)) { getLog().info("using latest stable data version: " + stableDataVersion); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "DataVersion", stableDataVersion); } getMavenGoals().createPlugin(getProductId(), ampsCreatePluginPrompter); }
if (StringUtils.isNotBlank(a.latest)) { getLog().info("using stable product version: " + a.latest); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "Version", a.latest); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "DataVersion", a.data); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "Version", stableVersion); getMavenContext().getExecutionEnvironment().getMavenSession().getExecutionProperties().setProperty(pid + "DataVersion", stableDataVersion);
public void afterProjectsRead( MavenSession session ) throws MavenExecutionException if ( "maven".equals( session.getExecutionProperties().get( "tycho.mode" ) ) ) properties.putAll( session.getExecutionProperties() ); // session wins project.setContextValue( TychoConstants.CTX_MERGED_PROPERTIES, properties );
ReleaseUtils.copyPropertiesToReleaseDescriptor( session.getExecutionProperties() ); mergeCommandLineConfig( config, sysPropertiesConfig );
public void execute() throws MojoExecutionException, MojoFailureException Properties executionProperties = session.getExecutionProperties(); try
= ReleaseUtils.copyPropertiesToReleaseDescriptor( session.getExecutionProperties() ); mergeCommandLineConfig( config, sysPropertiesConfig );
ReleaseUtils.copyPropertiesToReleaseDescriptor( session.getExecutionProperties() ); mergeCommandLineConfig( config, sysPropertiesConfig );