Questions tagged [properties-file]
A .properties file is either a simple text file or an XML file containing pairs of keys and values. Java and related technologies frequently use .properties files to store configuration information.
1,323
questions
0
votes
0
answers
14
views
Create internationalized properties under maven directory "test/resources" is a bad idea?
In order to tests our internationalized messages returned by our spring application, in our junit tests we usually create under maven directory "test/resources" the "messages.properties&...
1
vote
0
answers
26
views
Any better way to convert from YAML or JSON into a properties file (flatten object) using DataWeave?
I was able to produce this script that takes a YAML or JSON file and produce a properties file. I was looking if there is any optimization or pre-built function that make code smaller if exists. I ...
0
votes
1
answer
36
views
Why are the properties files missing in the target directory after compilation in Eclipse?
Some time ago I switched from Eclipse 4.7.3 EE-Edition to Eclipse 4.27 Standard-Edition. Since then I have had problems with the properties files. It happens from time to time that when I start a ...
1
vote
2
answers
51
views
Maven filtered properties file
Hi I tried to get hold of the artifact version number from my pom.xml to use it in this typical about & license information window. In essence I implemented the accepted solution given in ...
0
votes
0
answers
52
views
Handling multiple properties file in camel
Our project used to have two kinds of properties in camel. One is for the default configuration and the other is a web service info. Once we package an entire project in a jar format. We placed the ...
0
votes
1
answer
40
views
How to specify wildcard in application.properties?
I have an application.properties in a Spring Boot application. I want to specify allow all origins via a property called cors.allow.origin
But when I set it as below
cors.allow.origin='*'
and then ...
1
vote
2
answers
45
views
How can I @Autowire in an inner type in my custom @ConfigurationProperties?
Suppose I create my own custom config properties:
@ConfigurationProperties("a.b")
public record Custom(Topic topics) {
public record Topics(String topicA, String topicB) {}
}
I can ...
0
votes
0
answers
56
views
overriding library subflow properties in an IBM ACE Application using ibmint
Say I have an IBM ACE application with the following structure:
Application.V01
-- MessageFlow
----subflow1
-- MessageFlow2
----subflow1
----subflow2
-- Library
----subflow1
----subflow2
--------...
-1
votes
1
answer
92
views
Should I write profile based application.properties files in Quarkus? [closed]
In my organization we use Quarkus-based microservices.
We usually create a container from the main branch and deploy it in dev,qa, and prod.
To target these environments, we have different profiles. ...
1
vote
2
answers
254
views
How to load values for different appsettings.json files from their respective properties files in .NET Core
I am working on a .NET Core project where I have an appsettings.json file for each environment (Dev, Prod). I want to load values for these appsettings files from the respective properties files (...
0
votes
0
answers
46
views
How in Log4j2 properties file define arbiters or conditional logic?
So, while using log4j2 we can set in xml, yaml files arbiters, that will take env variable and run appropriate part of config based on that.
I'm using .properties file and I can't find anything in the ...
-2
votes
1
answer
30
views
ReloadableConfiguration getProperty returns null instead of map when reading from JSON property file
I need to have a ReloadableConfiguration that handles JSON files to read properties from a property file. Everything I tried, works fine for String or List but does not work for Map. It just returns ...
0
votes
1
answer
46
views
PowerShell Get All Files in Folder Tree LastAccessed and export to csv
I have a Powershell Script that I am using to try to Get ALL Files in a Folder Tree that were LastAccessedTime > 365 days ago. I know my script is using Plus 10 days - but that is for testing ...
0
votes
1
answer
62
views
Specifying a new location for ConfigurationProperties (Spring 2.7.13)
Suppose I have both an application.yml and query.yml in my resources folder. If I have a class
@Data
@ConfigurationProperties()
public class QueryConfiguration
private String propertyOne;
...
0
votes
0
answers
18
views
How to pull values from properties file into persistence.xml and context.xml?
I have an app with Java 17, Tomcat 10.
I would like to use a properties file (or its variation) so I can read it from different sides of my code or from my persistence.xml and context.xml files.
What ...
0
votes
0
answers
31
views
Micronaut: How to include a property file to be readed using environment class
I'm using micronaut.
I have a property file with some extra properties, the property file looks like this ("message.properties"):
my.key=a big message
my.key2=another message
other.key=...
0
votes
0
answers
20
views
how to apply logback-spring.xml file to multiple java packages/folders?
Currently I have 12 same logback-spring.xml files in 12 folders. I would like to replace them with one and specify it in f.e. data.properties file, which applies to all of my folders..
I tried to ...
-1
votes
1
answer
36
views
Update .properties or .yml file
Requirement: I have to update .properties or .yml file. Which is in parent module.
I have created spring boot custom library to get values from parent .properties or .yml and communicate to third ...
0
votes
1
answer
38
views
Spring Framework apllication-profile.properties doesn't set property value
This is my application.properties file
spring.profiles.active=de
username=postgres
password=12345
dburl=localhost:postgre
This is application-de.properties file
username=**** postgres
password=****...
0
votes
0
answers
66
views
java.lang.ExceptionInInitializerError: Property file not reading path
I am using eclipse on ubuntu 20.0
Here is my code to read property file:
public static String getProperty(String key) {
Properties properties = new Properties();
try {
URL myURL = ...
1
vote
1
answer
90
views
IntelliJ IDEA CE not highlighting keys in .properties files
(I'm using the Mac)
In Intellij Community Edition I'm using the default color scheme for the properties files:
with the .properties files, the colors are not being applied to the keys, whereas the ...
0
votes
2
answers
55
views
How to store enums in external file and import in java code
How to store enum in separate file and import in java code. In the following code I have created enum for hostMessages. In that, it has more than 3000 errorcodes. So it is failing to compile. So I am ...
1
vote
1
answer
946
views
@PropertySource doesn't override properties defined in application.properties
If any property is defined in application.properties, it cannot be overridden by re-defining it in other .properties files using the @PropertySource annotation. This bug is only valid if the original ...
0
votes
1
answer
15
views
Unable to locate the file while using ${user.dir} to avoid hardcoding in the @Config.Sources of the Owner library in Java
I am unable to locate the file while using ${user.dir} to avoid hardcoding in the @Config.Sources annotation of the Owner library in Java to locate the property file.
Using the absolute path to locate ...
0
votes
1
answer
84
views
Apache Camel simple variable expansion from a property
Is it possible to expand a simple expression contained in a property value?
I would like to dynamically create a filename from a property string.
In my .properties file I have.
part.a=SFAC
part.b=...
-2
votes
1
answer
32
views
Java properties file. Using part of a value to create another value (key-value) [closed]
I know that by using the ${} we can use the value of another key.
what if we want to use part of that value? for example, ignore the first 10 chars and use this value.
or using regular expressions for ...
0
votes
2
answers
333
views
SpringBoot: Inject Map from YAML file vs .properties file
Actually, I can load/inject a Map from a YAML file defined as follows:
# custom-auth.yaml
auth:
providers:
keycloak:
enabled: true
realmUrl: http://localhost:38087/auth/realms/my-app-...
1
vote
2
answers
649
views
Problem with special characters in properties file
I have properties files for translation. One file is in English, the other one in Swedish. For each page I want translation for I have separate properties files e.g. home.properties, home_en....
0
votes
1
answer
30
views
How to update java project properties with gradle commandline
I'm working on a java project and currently loading properties by:
properties.load(ConfigProperty.class.getClassLoader().getResourceAsStream("project.properties"));
But sometimes I also ...
0
votes
0
answers
23
views
save list of values to a field in properties file [duplicate]
I do have a field in properties file, called let's say "xxx". I read value from user and assign it to that variable with the use of apache-commons library. Now I would like to read from the ...
0
votes
0
answers
242
views
Why does my Java project can't read properties file created by Eclipse, but with Notepad or Visual Studio Code one?
I got a simple Java project to read properties file like this:
This is project structure
This is PropertiesFileReader class:
public class PropertiesFileReader {
public void ...
0
votes
1
answer
131
views
why the properties map to yaml return null
I have a java properties config look like this:
spring.cloud.gateway.routes[9].id = dict-auth
spring.cloud.gateway.routes[9].order = 0
spring.cloud.gateway.routes[9].predicates[0] = Path=/dict/user/...
0
votes
0
answers
44
views
How to disable the logging of the report in Spring Boot?
I want to disable the logging of the report in spring boot.
I used this property in properties file - spring.devtools.restart.log-condition-evaluation-delta=false
0
votes
0
answers
76
views
Spring Shell another properties location
how can I set another properties file location in Spring Shell?
When I try
java -jar ovh-email-creator.jar --spring.config.location=application.yaml
I got a
No command found for '--spring.config....
1
vote
0
answers
315
views
How to load Springboot application.properties, or application-profile.properties by passing in Properties objects at startup
How to pass in spring boot application properties directly at startup instead of using application.properties/application-profile.properties files?
I'm going to lead in with a similar question later ...
0
votes
0
answers
20
views
No getter for property file locations in org.springframework.core.io.support.PropertiesLoaderSupport
I got a Spring Application (Spring-Core 5.3.18) and my purpose is to log out the property files currently in use. The property files are configured in org.springframework.beans.factory.config....
0
votes
1
answer
72
views
Java Spring accesing property from application.properties
I have a entry on application.properties like this.
stackoverflow.questiontitle=I cant see this from environment
But in my code I'm unable to see it.
As you can see the @Value is working but this ...
0
votes
0
answers
40
views
How to reference a set of common properties shared across many Java (Spring/Boot) batches and is this even a good idea?
In our Spring Boot based Java project, I am attempting to find the best way to solve this problem.
Right now, we have a directory full of Java based batch applications that follow the conventional ...
0
votes
0
answers
103
views
Using maven properties plugin to access custom properties
I've created a maven archetype which works just fine, but I would like to set some properties based on who generates the archetype.
This is how I'm incorporating the plugin:
<build>
<...
0
votes
1
answer
311
views
How to set values inside the enum directly from the properties file key?
I have been trying to load string values by inserting the keys from properties file inside the enum constructor. But instead of setting the values, it's setting the keys only.
My errorcodes.properties ...
0
votes
1
answer
296
views
What is the default path of ResourceBundle.getBundle() to access the properties file
While writing unit tests for a small component that is part of a relatively massive Java Project, I came across the need to use a method in another class TheOtherClassNoPartOfMyProject that will ...
-1
votes
2
answers
96
views
How to export dictionary as a .property file in python
How can a dictionary in python be exported to .properties file type in python?
What I have:
dict = {"key1":"sentence1", "key2":"sentence2"}
The object dict ...
0
votes
0
answers
138
views
Maven uber-jar generation uses application.properties of dependency instead of its own
I have a quarkus maven project which has properties in src/main/application.properties. This project also has a local dependency that also contains src/main/application.properties since there are ...
0
votes
1
answer
95
views
JMeter integration with AWS getting issue with Config.properties file
I have integrated successfully JMeter with AWS but I am getting an issue when we run the script . In this we have Config.properties file & we convert .jmx & other data into zip file including ...
0
votes
0
answers
54
views
getProperty from Properties.java file is returning ${browser} instead of null when no value is passed
So, we have this selenium.properties file from where we get the browser details from the below tag.
browser = ${browser}
When we run through maven command, this value get populated based on what we ...
3
votes
1
answer
3k
views
Java Spring Boot custom properties doesn't work in application.yml
I'm following a tutorial on Java Spring Boot and the current topic is that one can use both application.properties and application.yml
So my application.properties looked like this:
spring.profiles....
1
vote
0
answers
248
views
I have a null when using a relative path when reading a FileInputStream
I am trying to read a .properties file from a class that is in a different folder than this .properties. Firstly, I have used another class with a main (testLogin.java) to see if the paths I use are ...
0
votes
0
answers
70
views
How to use Reflection when reading properties file
I am trying to use a properties file, named logging.properties, to instantiate an Handler while using java.util.logging libraries. In the logging.properties file i have the line "handlers=java....
0
votes
0
answers
94
views
How can i exclude certain files from a maven dependency?
I have a maven project that includes a dependency of a local custom maven repository. However, there are files in it i do not want in my main project because they seem to override configs in the main ...
0
votes
0
answers
140
views
How to add properties file to Spring XML context?
Here is the structure of sample Spring application
src
main
my.example
- MyBean.java
- AppMain.java
resources
- applicationContext.xml
- some.properties
...