0

is there any way to moving dependencies from pom.xml to application.properties file?

  <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.3.3</version>
    </dependency>  

somehow move to src/main/resources/application.properties?

enter image description here

Brent Worden
  • 10,624
  • 7
  • 52
  • 57
стасевич
  • 298
  • 2
  • 10
  • what is the use case of it? – tuhin47 Mar 19 '22 at 05:45
  • @tuhin47 im on trainee and mentor write in pull request to move dependencies to properties – стасевич Mar 19 '22 at 05:47
  • What you are asking for and saying makes no sense. You need to explain much better what you are trying to do and why. – RoToRa Mar 19 '22 at 11:28
  • @RoToRa i have a very strange mentor, he can not to answer for my questions for the whole day... i'd love to explayne, but i dont understand what he want from me – стасевич Mar 19 '22 at 13:12
  • 1
    @стасевич Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Please see: [Why is “Is it possible to…” a poorly worded question?](https://softwareengineering.meta.stackexchange.com/q/7273). Please show your attempts you have tried and the problems/error messages you get from your attempts. – Progman Mar 19 '22 at 13:18
  • 1
    @стасевич You might want to check other questions like https://stackoverflow.com/questions/849389/how-to-read-an-external-properties-file-in-maven – Progman Mar 19 '22 at 13:19

1 Answers1

1

Your mentor is not asking you to move the dependencies to the file application.properties, but to move the dependency versions to the <properties> section of the maven file (pom.xml).

Example:

<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>${postgresql.version}</version>
</dependency>  

And then in the <properties> section:

<properties>
  <postgresql.version>42.3.3</postgresql.version>
</properties>
RoToRa
  • 37,635
  • 12
  • 69
  • 105