There is a maven project A. Once I do mvn clean install, the project builds and the jar is available at my local repository ie c:\\repository\\com\\stackoverflow\\A\\A.jar<
I think you're asking the wrong question. You probably want to know has to access p.xml. The best way is to put A.jar on the classpath, which you do by specifying it as a dependency in the pom.xml of "the other Maven Project".
In your code you do the following:
Foo.class.getResource("/thePackagePath/to/p.xml");
By trying to access the xml as a file, you make your project very bad portable to other systems.