Posts

Showing posts with the label environment-variables

Best way to set environment variable and execute command in one line

Image
Clash Royale CLAN TAG #URR8PPP Best way to set environment variable and execute command in one line I want to make a backup with PostGreSQL pg_dump command with command line like : "<c:Program FilesPostgreSQL9.6binpg_dump>" -h localhost -p 5432 -d test_backup_bat -U user -f D:destination_backuptest.backup but I need to set PGPASSWORD before as environment variable to execute the backup command PGPASSWORD=mypassword How can I make this in only one command line into Windows CLI ? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to use single property file for all spring modules

Image
Clash Royale CLAN TAG #URR8PPP How to use single property file for all spring modules I have 3 spring modules with their own Configuration files. e.g. SP1,SP2, SP3. SP3 module initialize context for all 3 modules using private static AnnotationConfigApplicationContext validatorContext = new AnnotationConfigApplicationContext(SP3.class, SP2.class, SP1.class); SP3 have property file which gets loaded for SP3 only. i would like to use SP3 environment variables in other modules as well. So if properties are loaded once its properties shall be used by other modules. My other module i.e. SP2 configuration file has following code : @Autowired @Bean public ValidationConfigurationLoader validationConfigurationLoader(final Environment environment){ ValidationConfigurationLoader validationConfigurationLoader = new ValidationConfigurationLoader(); validationConfigurationLoader.setValidationConfigurationFilePath(environment.getProperty("referenceccda.configFile"))...