public Project build(ResourceRef resourceRef) {
		if (!buildRefs.add(resourceRef)) {
			throw new ExitException(BaseCommand.EXIT_INVALID_INPUT,
					"Self-referencing project dependency found for: '" + resourceRef.getOriginalResource() + "'");
		}

		Project prj;
		if (resourceRef.getFile().getFileName().toString().endsWith(".jar")) {
			prj = createJarProject(resourceRef);
		} else if (Util.isPreview()
				&& resourceRef.getFile().getFileName().toString().equals(Project.BuildFile.jbang.fileName)) {
			prj = createJbangProject(resourceRef);
		} else {
			prj = createSourceProject(resourceRef);
		}
		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