Given a project with several modules - each of which could contain a certain identically named file (say an xml config file) - how do I get the file given the module?
I know how to do this if I have the Artifact:
PackagingElementResolvingContext context = ArtifactManager.getInstance(project).getResolvingContext();
VirtualFile descriptorFile = ArtifactUtil.findSourceFileByOutputPath(artifact, "my_config.xml", context);
XmlFile myConfig = (XmlFile) PsiManager.getInstance(project).findFile(descriptorFile);
How do I do something similar given a Module?
Note: I know that given a Module I can get a list of Artifacts containing the module output. However this doesn't seem ideal as I know that I don't need to search each Artifact for the desired config file.