private void renderTemplate(TemplateEngine engine, List<String> collectDependencies, String fullclassName,
			String baseName, List<String> resolvedDependencies, List<MavenRepo> repositories, ResourceRef templateRef,
			List<String> userParams, Path destination)
			throws IOException {
		Template template = engine.getTemplate(templateRef);
		if (template == null)
			throw new ExitException(EXIT_INVALID_INPUT, "Could not locate template named: '" + templateRef + "'");
		String result = template
			.data("repositories",
					repositories.stream()
						.map(MavenRepo::getUrl)
						.filter(s -> !"".equals(s)))
			.data("dependencies", collectDependencies)
			.data("gradledependencies", gradleify(collectDependencies))
			.data("baseName", baseName)
			.data("fullClassName", fullclassName)
			.data("classpath",
					resolvedDependencies.stream()
						.filter(t -> !t.isEmpty())
						.collect(Collectors.toList()))
			.data("userParams", String.join(" ", userParams))
			.data("cwd", System.getProperty("user.dir"))
			.render();

		Util.writeString(destination, result);
	}
Create Project to use for editing *
src/main/java/dev/jbang/cli/Edit.java