code: public static ArchetypeCatalog getArchetypeCatalog(Artifact artifact) throws Exception {
          File file = artifact.getFile();
          if (file != null) {
              URL url = new URL("file", (String) null, file.getAbsolutePath());
              URLClassLoader loader = new URLClassLoader(new URL[]{url});
              InputStream is = loader.getResourceAsStream("archetype-catalog.xml");
              if (is != null) {
                  return (new ArchetypeCatalogXpp3Reader()).read(is);
              }
          }
          return null;
      }
docs: Gets the archetype-catalog from the given maven artifact