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.
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.