private Project importJarMetadata(Project prj, boolean importModuleName) {
		Path jar = prj.getResourceRef().getFile();
		if (jar != null && Files.exists(jar)) {
			try (JarFile jf = new JarFile(jar.toFile())) {
				String moduleName = ModuleUtil.getModuleName(jar);
				if (moduleName != null && importModuleName) {
					// We only import the module name if the project's module
					// name was set to an empty string, which basically means
					// "we want module support, but we don't know the name".
					prj.setModuleName(moduleName);
				}

				if (jf.getManifest() != null) {
					Attributes attrs = jf.getManifest().getMainAttributes();
					if (attrs.containsKey(Attributes.Name.MAIN_CLASS)) {
						prj.setMainClass(attrs.getValue(Attributes.Name.MAIN_CLASS));
					}
					String ver = attrs.getValue(JarBuildStep.ATTR_BUILD_JDK);
					if (ver != null) {
						// buildJdk = JavaUtil.parseJavaVersion(ver);
						prj.setJavaVersion(JavaUtil.parseJavaVersion(ver) + "+");
					}

					// we pass exports/opens into the project...
					// TODO: this does mean we can't separate from user specified options and jar
					// origined ones, but not sure if needed?
					// https://openjdk.org/jeps/261#Breaking-encapsulation
					String exports = attrs.getValue("Add-Exports");
					if (exports != null) {
						prj.getManifestAttributes().put("Add-Exports", exports);
					}
					String opens = attrs.getValue("Add-Opens");
					if (opens != null) {
						prj.getManifestAttributes().put("Add-Opens", exports);
					}

				}

				Optional<JarEntry> pom = jf.stream().filter(e -> e.getName().endsWith("/pom.xml")).findFirst();
				if (pom.isPresent()) {
					try (InputStream is = jf.getInputStream(pom.get())) {
						MavenXpp3Reader reader = new MavenXpp3Reader();
						Model model = reader.read(is);
						// GAVS of the form "group:xxxx:999-SNAPSHOT" are skipped
						if (!MavenCoordinate.DUMMY_GROUP.equals(model.getGroupId())
								|| !MavenCoordinate.DEFAULT_VERSION.equals(model.getVersion())) {
							String gav = model.getGroupId() + ":" + model.getArtifactId();
							// The version "999-SNAPSHOT" is ignored
							if (!MavenCoordinate.DEFAULT_VERSION.equals(model.getVersion())) {
								gav += ":" + model.getVersion();
							}
							prj.setGav(gav);
						}
					} catch (XmlPullParserException e) {
						Util.verboseMsg("Unable to read the JAR's pom.xml file", e);
					}
				}

			} catch (IOException e) {
				Util.warnMsg("Problem reading manifest from " + jar);
			}
		}
		return prj;
	}
This class constructs a <code>Project</code>. It uses the options given by
the user on the command line or things that are part of the user's
environment.
src/main/java/dev/jbang/source/ProjectBuilder.java