thorntail / thorntail-generator

Thorntail Generator Server-side
http://wildfly-swarm.io/generator
3 stars 6 forks source link

SWARM-733: Generator does not honor group/artifact id for package #1

Closed doobrie closed 8 years ago

doobrie commented 8 years ago

Motivation

This commit is required to change the WildFly Swarm Generator application to take into account the maven groupId and artifactId when creating a project that includes JAXRS resources. In this situation, an example JAXRS endpoint is created in a package appropriate to the specified groupId and artifactId.

The package for the generated JAXRS endpoint was discussed on the WildFly Swarm mailing list.

Modifications

The ProjectGeneratorResource has been modified to have two ClassLoaderTemplateResolvers so that both the pom.tl.xml template and the HelloWorldEndpoint.tl.java can successfuly be generated. Thymeleaf requires two template resolvers as these files have different template modes (XML and TEXT respectively).

A new class, EndpointFilePathGenerator (and associated tests) has been created to aid with the construction of the path to the example rest end point. This class is responsible for generating the endpoint path and stripping all non alpha-numeric characters form the package name.

The HelloWorldEndpoint.tl.java template has been modified to merge the newly generated package.

Result

This commit changes the WildFly Swarm Generator application to use a sensible package name for the example JAXRS endpoint created for project containing JAXRS.

gastaldi commented 8 years ago

Thank you!

gastaldi commented 8 years ago

I'll push to Openshift tomorrow morning.

gastaldi commented 8 years ago

Done, it's live now. Thank you once again!