Maven Runtime

Maven Runtime allows introspection of Maven project metadata at runtime. Basic artifact information or full Maven project metadata can be obtained for all projects within a given class loader, optionally sorted into dependency order, and also for a given class within a project. These techniques can used by tools wishing to utilize Maven metadata at runtime.

Maven metadata is obtained from one of the two Maven descriptor files automatically generated by the Maven Archiver: and pom.xml in the META-INF/<groupId>/<artifactId> directory. The project properties file provides basic artifact information (group id, artifact id and version), whereas the project XML file provides full Maven metadata contained within the project's POM.

Note that since Maven Runtime uses resources generated by the Maven Archiver, it can only successfully introspect the runtime environment when executed from within the packaged project, as opposed to running within an IDE.

Note: Maven Runtime requires at least Java 5.


Instructions on how to use Maven Runtime can be found on the usage page.


To provide you with better understanding of some usages of Maven Runtime, you can take a look into the following examples: