Skip to content

uia4j/uia-archetype-restful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Archetype of RESTful API

Description

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

image/p1.png

AppResourceConfig.java

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

SystemWebService.java

A simple service at /api/v1/system endpoint:

@Path("/system")
public class SystemWebService extends AbstractWebService {
}

How to Use

Install to the local repository

  1. clone this source and open by Eclipse IDE
  2. Install the archetype to local m2 repository

image/p1.png

  1. Reindex local repository

image/p1.png

New Maven Project

  1. Check Include snapshot archetypes to display SNAPSHOT items.
  2. Select uia-archetype-restful

image/p1.png

Releases

No releases published

Packages

No packages published