The archetype can generate a Maven project to develop a RESTful API application.
The generated project is configured ready:
- Listener
- Response Filter
- Simple API implementation for testing
- SQLException Mapper
- app.properties support
- profile support
Setup package to be scanned and register some filters.
public class AppResourceConfig extends ResourceConfig {
public AppResourceConfig() {
packages("com.gs.swim.web.v1");
register(SQLExceptionMapper.class);
register(MyContainerResponseFilter.class);
register(MyContextResolver.class);
register(MyJacksonFeature.class);
}
A simple service at /api/v1/system
endpoint:
@Path("/system")
public class SystemWebService extends AbstractWebService {
}
- clone this source and open by Eclipse IDE
- Install the archetype to local m2 repository
- Reindex local repository
- Check Include snapshot archetypes to display SNAPSHOT items.
- Select uia-archetype-restful