Posts tagged ‘Eclipse’

Jbpm archetype for Maven

Update:

The archetype is updated and available from this dedicated site.

Working with Jboss JBPM in conjunction with maven could be made simpler and easier when using this little useful maven archetype to generate starting-block jbpm projects. I built this artifact on top of the skeleton project generate under Eclipse by the Jboss JBPM Eclipse plugin, but with much more enhancement.

Features

  • Junit tests are upgraded to junit 4, and use the hamcrest assertions
  • All required configuration files are included and default DataBase is MySQL 5
  • There are 2 junit tests : one for testing the process from a local process definition XML, and one for making the same test but loading the process from a Database (this means the process should be deployed in prior)
  • Maven dependencies are included, even a C3PO pool connection manager
  • No more “default” package. The desired package name for java classes could be chosen when generating the project and the filtering mechanism will applied to java classes packages declarations as well as “class” attribute for Action elements in the process definition.
  • It works smoothely with JBPM 3.2.3 (latest stable release) and integrates seamlessly with M2Eclipse maven plugin under Eclipse Ganymede.
  • Generated projects are targeting jdk 1.5

prerequisites

  • Maven 2.0.9
  • Jboss JBPM 3.2.3 Eclipse plugin
  • M2Eclipse maven plugin for Eclipse (Optional)

Download

The archetype can be downloaded from here.

Installation

The installation is a straight-forward one line maven command

D:\workspace\archetype-jbpm>mvn clean package install archetype:update-local-catalog
[INFO] Scanning for projects…
[INFO] Searching repository for plugin with prefix: ‘archetype’.
[INFO] ————————————————————————
[INFO] Building Archetype-JBPM
[INFO] task-segment: [clean, package, install, archetype:update-local-catalog]
[INFO] ————————————————————————
etc

Usage

The archetype can be used either naturally from the command line, and it goes like this:

mvn archetype:create -DarchetypeGroupId=net.labidi -DarchetypeArtifactId=archetype-jbpm -DarchetypeVersion=1.0.0 -DgroupId=mycompany -DartifactId=myjbpmproject

or it can be used from M2Eclipse plugin, which is the way I prfer to use (How many people are out there coding JBPM process from outsides IDEs ?)

Creating from local archetype catalog with M2Eclipse

Creating from local archetype catalog with M2Eclipse

choosing project coordinates. Package name is auto-filled

choosing project coordinates. Package name is auto-filled

Generated JBPM Maven project under eclipse

Generated JBPM Maven project under eclipse

Maven Dependencies under M2Eclipse

Maven Dependencies under M2Eclipse

Exept Junit, all other dependencies are provided-scoped. This because JBPM project are basically aimed to be deployed under an application server whose container provides almost of theses packages (except jbpm-jpdl, jbpm-identity and c3po, they need to be deloyed once for all into the aplication server)