F
F
Fedor unknown2021-09-18 09:38:00
Java
Fedor unknown, 2021-09-18 09:38:00

Whether it is possible to register the domain, login, etc. in properties?

Hello!
I am writing an FTP client in Java (Spring boot), I want to enter the domain, login and password in the application.properties file so that I don’t have to go into the code to change the server every time.
Is it possible? If so, can you please share the links?
Googled it myself but couldn't find it.

Question #2: How can I add properties for a jar?

Ps I'm still a beginner, if the questions seem stupid, then I'm sorry)))

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BorLaze, 2021-09-18
@turdubekov

I want to enter the domain, login and password in application.properties

it is possible, but there is
no need to store such information in the version control system (you use it, right?)
How can I add properties for jar?

next to the jar you create an application.properties file - the data from it will override those properties that are written in application.properties inside the jar
if the application is running under some other profile (dev, for example), you name the external property file accordingly (application-dev. properties).
should work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question