Saturday, July 20, 2013

Maven Archetype

Maven Archetype


While working in multi-tiered , potentially big projects, there are highly chances of having small sub projects, mainly intended to divide team in individual or pair of two.

In Service level, as per Service oriented Architecture, each service is considered independent on others and its also preferred to develop independently.

But the major fact is in such cases, the blue-print of all services is almost same. Blue-print means the folder structure, major configuration files, nominations of services. In summary the folder structure's like API, DAO, Helper, Constants, Logging and configuration like DB Handling, Session Handling is same at least by prototype.


Yes, when its almost same besides their name and variables inside it, then Maven Archetype comes in picture.

Maven archetype is code generator utility which is helpful to build basic infrastructural of services on run time by entering couple of fields.

So to start with Archetype, first you have to create a basic service with all files and folders structured and packed in one place. All the variables which will be changed as per the service name should be written like ${service-name}.