Question: How do I get my custom maven plugin to programmatically query and fetch non-standard maven files in a maven repository such as xml files that were uploaded along with the pom, jar, etc ?
Background info: I’m writing a maven plugin that creates feature.xml files for a project from the dependencies found in the pom file. I know feature-maven-plugin exists already, but I’m trying to do more such as check if a dependency has a “feature.xml” in the repository and if it does download it and include it into the newer project’s feature.xml. I’m not really sure where to start on this, any help would be appreciated.
If you express it as a dependency, it will just be there in the dependencies.
Otherwise, you have to call the artifact resolver to resolve it. The approach to things like this is to find an existing plugin that has the same problem and read its source code.
For example, read the
maven-eclipse-plugin‘s support fordownloadSourcesanddownloadJavadoc.