[JBoss JIRA] (FORGE-2693) Use ShrinkWrap to generate new projects
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2693?page=com.atlassian.jira.plugin... ]
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
…
[View More]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)
[View Less]