I have a big Java project and each sub-part of the project has a child pom.xml. The parent pom has key data I want, username and password. My question is how can I extract this data from a parent pom.xml in my java program? 

The parent pom.xml has numerous profiles in the profile section where the data is that I need. I found a similar example that said to simply code `System.getProperty('property.name');` When I tried this the code just returned null though. I think it is because I ran the code from the `target` directory and not through Maven, but I could be completely wrong about this. 

Does anyone know what I am missing?

Regards,