-1

I have one parent pom.xml file and multiple child pom.xml files. There are multiple versions for various dependencies defined in properties> tag. I would like to move all that is written in properties> tag to ".property" file.

The issue is that pom.xml are not able to read property file.

I tried using file> tag but still no success. Can somebody please help.

Developer
  • 13
  • 4

1 Answers1

0

You might want to clarify your Question, but as much as i understand is that you want to read/write a Property File in Java.

If so there is inbuild mecanisms you can use.

https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html

Levent Dag
  • 162
  • 8
  • Thanks for the reply. i want to move all the versions mentioned below to .property file and read that from pom.xml: 7.0 5.2.4.Final – Developer May 06 '18 at 20:23
  • @Shilpa well then you gotta read those xml property tags, via xmlparsing and write it into a properties object and save it. – Levent Dag May 06 '18 at 20:26
  • Is there no other way to use some tags in pom.xml to read some ".property file" ? – Developer May 06 '18 at 20:30
  • @Shilpa So you want to basically do something like this right? pom.xml: " 7.0 5.2.4.Final" --> configuartion.property: "jee.version = 7.0 \n hibernate.version = 5.2.4". If so you should read the answer to this post. https://stackoverflow.com/questions/11500533/access-maven-properties-defined-in-the-pom – Levent Dag May 06 '18 at 20:34
  • @Lavent I do not want to make use of "java" file. i check for tag as well but looks like it is not working – Developer May 08 '18 at 08:53