Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2693

Use ShrinkWrap to generate new projects

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Major
    • None
    • None
    • Brainstorming, Projects
    • None

    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:

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

      More information about ShrinkWrap: https://developer.jboss.org/wiki/ShrinkWrap

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-ggastald George Gastaldi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: