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

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


     [ https://issues.jboss.org/browse/FORGE-2693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Gastaldi updated FORGE-2693:
-----------------------------------
    Description: 
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


  was:
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}




> 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);
> // 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



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


More information about the forge-issues mailing list