[forge-issues] [JBoss JIRA] (FORGE-2693) Use ShrinkWrap to generate new projects

George Gastaldi (JIRA) issues at jboss.org
Sat Oct 29 00:52:00 EDT 2016


George Gastaldi created FORGE-2693:
--------------------------------------

             Summary: 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
             Fix For: 3.x Future


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);
{code}




--
This message was sent by Atlassian JIRA
(v7.2.2#72004)


More information about the forge-issues mailing list