[forge-users] Scaffold strategies

George Gastaldi ggastald at redhat.com
Thu Mar 9 13:07:12 EST 2017


1) To create a JavaClass you are free to choose whether Freemarker
templates are more adequate or use Roaster to create the class using an API
[1]
2) To create an application.yaml file, you can use this code:

ResourcesFacet resources = project.getFacet(ResourcesFacet.class);
YamlResource applicationYaml = resources.getResource("
application.yaml").as(YamlResource.class);
applicationYaml.createNewFile();
// Manipulate the model as in [2]


[1] https://github.com/forge/roaster
[2] https://github.com/forge/core/blob/master/parser-yaml/README.asciidoc

*George Gastaldi*

https://onename.com/gastaldi

On Thu, Mar 9, 2017 at 2:59 PM, Charles Moulliard <cmoullia at redhat.com>
wrote:

> Hi,
>
> As there are different strategies to scaffold code of a project, I would
> like to get your opinion about the idea to use the template approach (ex.
> Rest.ftl) using freemarker [1] or to create the files using JavaFacet, ....
> for a Spring project
>
> Can we create easily a Java Class with @Annotations ?
> What do you suggest to do to by example setup
> src/main/resources/application.yaml file
>
> [1] https://github.com/obsidian-toaster/obsidian-addon/blob/mast
> er/src/main/java/org/obsidiantoaster/generator/ui/starter/
> PerformExtraTasksStep.java
> [2] : https://github.com/forge/wildfly-swarm-addon/blob/master/
> src/main/java/org/jboss/forge/addon/swarm/ui/CreateRestEndpo
> intStep.java#L47-L60
>
> Regards,
>
> Charles
>
> _______________________________________________
> forge-users mailing list
> forge-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-users/attachments/20170309/7feb3e38/attachment-0001.html 


More information about the forge-users mailing list