code: public static Model readPom(String path, JarFile jar) throws AnalysisException {
          final ZipEntry entry = jar.getEntry(path);
          Model model = null;
          if (entry != null) { //should never be null
              //noinspection CaughtExceptionImmediatelyRethrown
              try {
                  final PomParser parser = new PomParser();
                  model = parser.parse(jar.getInputStream(entry));
                  if (model == null) {
                      throw new AnalysisException(String.format("Unable to parse pom '%s/%s'", jar.getName(), path));
                  }
              } catch (AnalysisException ex) {
                  throw ex;
              } catch (SecurityException ex) {
                  LOGGER.warn("Unable to parse pom '{}' in jar '{}'; invalid signature", path, jar.getName());
                  LOGGER.debug("", ex);
                  throw new AnalysisException(ex);
              } catch (IOException ex) {
                  LOGGER.warn("Unable to parse pom '{}' in jar '{}' (IO Exception)", path, jar.getName());
                  LOGGER.debug("", ex);
                  throw new AnalysisException(ex);
              } catch (Throwable ex) {
                  LOGGER.warn("Unexpected error during parsing of the pom '{}' in jar '{}'", path, jar.getName());
                  LOGGER.debug("", ex);
                  throw new AnalysisException(ex);
              }
          }
          return model;
      }
docs: Retrieves the specified POM from a jar file and converts it to a Model.
  
  @param path the path to the pom.xml file within the jar file
  @param jar the jar file to extract the pom from
  @return returns an object representation of the POM
  @throws AnalysisException is thrown if there is an exception extracting
  or parsing the POM {@link Model} object