use of io.syndesis.integration.project.generator.ProjectGeneratorConfiguration in project syndesis by syndesisio.
the class Application method generate.
@SuppressWarnings("PMD.UseProperClassLoader")
private void generate(Integration integration, File targetDir) throws IOException {
ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration();
IntegrationProjectGenerator generator = new ProjectGenerator(configuration, new EmptyIntegrationResourceManager(), mavenProperties);
Path dir = targetDir.toPath();
Files.createDirectories(dir);
Files.write(dir.resolve("pom.xml"), generator.generatePom(integration));
dir = dir.resolve("src/main/java/io/syndesis/example");
Files.createDirectories(dir);
ClassPathResource resource = new ClassPathResource("io/syndesis/integration/project/generator/templates/Application.java.mustache");
try (InputStream is = resource.getInputStream()) {
Files.write(dir.resolve("Application.java"), IOUtils.toByteArray(is));
}
}
use of io.syndesis.integration.project.generator.ProjectGeneratorConfiguration in project syndesis by syndesisio.
the class ConnectorTestSupport method useOverridePropertiesWithPropertiesComponent.
@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
try {
ProjectGeneratorConfiguration configuration = new ProjectGeneratorConfiguration();
ProjectGenerator projectGenerator = new ProjectGenerator(configuration, new ResourceManager(), new MavenProperties());
return projectGenerator.generateApplicationProperties(newIntegration());
} catch (IOException e) {
Assertions.fail("Unable to generate integration properties", e);
}
return null;
}
Aggregations