'Moving dependencies from pom to properties file

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



Solution 1:[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>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1