]
George Gastaldi closed FORGE-2693.
----------------------------------
Fix Version/s: (was: 3.x Future)
Resolution: Deferred
Use ShrinkWrap to generate new projects
---------------------------------------
Key: FORGE-2693
URL:
https://issues.jboss.org/browse/FORGE-2693
Project: Forge
Issue Type: Enhancement
Components: Brainstorming, Projects
Reporter: George Gastaldi
ShrinkWrap is a Java API for Archive Manipulation. It would be nice to use it to assemble
a project structure. With Roaster and the Maven model APIs, it would be a perfect
candidate to generate Maven projects with Java sources for example.
Code sample:
{code:java}
// This would create an Archive representation of the project
MavenArchive archive = ShrinkWrap.create(MavenArchive.class);
archive.setPomXml(mavenModel);
archive.addJavaSource(Roaster.create(JavaClassSource.class).setName("Foo").setPackage("com.example.demo"));
// We can export this to a ZIP file
archive.as(ZipExporter.class).exportTo(new File("project.zip"), true);
// Or we can explode in a specified location
archive.as(ExplodedExporter.class).exportExploded(destinationDir);
{code}
More information about ShrinkWrap:
https://developer.jboss.org/wiki/ShrinkWrap