Activiti Maven Archetype

As activiti developer, It happens too often that one has to create sample test cases . Some boilerplate code is necessary even for the most basic test case to run. Things like sample config file, sample process model, test case.

To make it faster, Joram has created a “Activiti Unit Test template” which makes life much easier. Personally I have used it a lot. It does most of the job, but again you need to do some customization to fully use it. To say, if you use multiple copies, without change, you can import only one of them in Eclipse.

There are tools for scaffolding and generating which allow faster, more dynamic and customizable templates. As maven is already used, maven archetype seems to be the logical tool.

In the most recent version of activiti (version 5.17.1) , the  first activiti maven archetype contains the same code written by Joram, in a new shell.

The archetype will be available in standard activiti maven repository. This simple command, will create a unit test template.

mvn archetype:generate


The first three parameters  specify the archetype to be used. GroupId and artifactId determines your customized groupId and artifactId. Packages will be created according to the given group Id.

As simple is that.

This is just the start. Lot’s of extensions are possible. Ideas like creating a template for a web application (one with angular.js and one with jsf), selecting database type and so on.


Leave a Reply

Your email address will not be published. Required fields are marked *