How to read application.properties from POM.xml

Viewed 4184

I'm not able to find out if it is possible to read any data in Spring's application.properties in the pom.xml file.

In my application-dev.properties file, I have an attribute:

google.project.id = 123456789

In my application-test.properties file, I have an attribute:

google.project.id = 987654321

In my application.properties file, I have an attribute. At one point I set it up for DEV at another time for TEST:

spring.profiles.active=dev 

In my pom.xml file, I would like to read this project id according to the configuration in the spring.profiles.active attribute:

<configuration>
  <projectId> PROJECT ID ???</projectId>
  <version>1</version>
</configuration>

Please, could someone help me?

Thank you.

1 Answers

POM.xml is part of maven project build and has nothing to do with spring.

Spring framework has no idea about pom file.

Related