We provide several project templates for Maven, which are also called Archetypes.They enable a quickstart for developing process applications using the Camunda BPM platform.

Overview of Available Maven Archetypes

The following archetypes are currently provided. They are distributed via our Maven repository: https://app.camunda.com/nexus/content/repositories/camunda-bpm/

Archetype Description
Camunda Cockpit Plugin Plugin for Camunda Cockpit, contains REST-Backend, MyBatis database query, HTML and JavaScript frontend, Ant build script for one-click deployment
Process Application (EJB, WAR) Process application that uses a shared Camunda BPM engine in a Java EE Container, e.g., JBoss Wildfly. Contains: Camunda EJB Client, Camunda CDI Integration, BPMN Process, Java Delegate as CDI bean, HTML5- & JSF-based start and task forms, configuration for JPA (Hibernate), JUnit Test with in-memory engine and visual process test coverage, Arquillian Test for JBoss AS7 & Wildfly, Maven Plugins or Ant build script for one-click deployment in Eclipse
Process Application (Servlet, WAR) Process application that uses a shared Camunda BPM engine in a Servlet Container, e.g., Apache Tomcat. Contains: Servlet process application, BPMN Process, Java Delegate, HTML5-based start and task forms, JUnit Test with in-memory engine, Maven Plugins or Ant build script for one-click deployment in Eclipse

Usage in Eclipse IDE

Summary

  • Add archetype catalog (Preferences -> Maven -> Archetypes -> Add Remote Catalog):https://app.camunda.com/nexus/content/repositories/camunda-bpm/
  • Create Maven project from archetype (File -> New -> Project… -> Maven -> Maven Project)

    Detailed Instructions

  • Go to Preferences -> Maven -> Archetypes -> Add Remote Catalog
    Maven Project Templates (Archetypes) - 图1

  • Enter the following URL and description, click on Verify… to test the connection and if that worked click on OK to save the catalog.

Catalog File: https://app.camunda.com/nexus/content/repositories/camunda-bpm/

Description: camunda BPM platform

Maven Project Templates (Archetypes) - 图2

Now you should be able to use the archetypes when creating a new Maven project in Eclipse:

  • Go to File -> New -> Project… and select Maven -> Maven Project
    Maven Project Templates (Archetypes) - 图3

  • Select a location for the project or just keep the default setting.
    Maven Project Templates (Archetypes) - 图4

  • Select the archetype from the catalog that you created before.
    Maven Project Templates (Archetypes) - 图5

  • Specify Maven coordinates and Camunda version and finish the project creation.
    Maven Project Templates (Archetypes) - 图6

The resulting project should look like this:

Maven Project Templates (Archetypes) - 图7

Troubleshooting

Sometimes the creation of the very first Maven project fails in Eclipse. If that happens to you, just try it again. Most of the times the second try works. If the problem persists, contact us.

Usage in IntelliJ IDE

Summary

Interactive

Run the following command in a terminal to generate a project. Maven will allow you to select an archetype and ask you for all parameters needed to configure it:

  1. mvn archetype:generate -Dfilter=org.camunda.bpm.archetype: -DarchetypeCatalog=https://app.camunda.com/nexus/content/repositories/camunda-bpm

Full Automation

The following command completely automates the project generation and can be used in shell scripts or Ant builds:

  1. mvn archetype:generate
  2. -DinteractiveMode=false
  3. -DarchetypeRepository=[https://app.camunda.com/nexus/content/repositories/camunda-bpm](https://app.camunda.com/nexus/content/repositories/camunda-bpm)
  4. -DarchetypeGroupId=org.camunda.bpm.archetype
  5. -DarchetypeArtifactId=camunda-archetype-ejb-war
  6. -DarchetypeVersion=7.0.0
  7. -DgroupId=org.example.camunda.bpm
  8. -DartifactId=camunda-bpm-ejb-project
  9. -Dversion=0.0.1-SNAPSHOT
  10. -Dpackage=org.example.camunda.bpm.ejb

Source Code and Customization

You can also customize the project templates for your own technology stack. Just fork them on GitHub!

原文: https://docs.camunda.org/manual/7.9/user-guide/process-applications/maven-archetypes/