Activiti Guidelines (Creating and Setting Maven Projects)

Keywords: Java Maven Apache snapshot

Create and set up Maven projects

Create a Java project called "Activity Developer QuickStart" (hereinafter referred to as $quickStart Java Project Name), which contains the following Maven dependencies:

Document: $mvnProject/pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>$quickStartJavaProjectName</groupId>
  <artifactId>$quickStartJavaProjectName</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <!-- ... other configurations may exist, such as a build stanza, depending your environment ... -->

  <dependencies>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-engine</artifactId>
      <version>$actVer</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.21</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.21</version>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.4.193</version>
    </dependency>
  </dependencies>
</project>

Of course, $actVer will be replaced with the downloaded Activiti version. For example, if the Activiti package you downloaded is "Actiti-5.22.0", then the value of $actVer will be 5.22.0.

Note the following dependencies:

  • Activiti (org.activiti) - BPM engine of Activiti
  • Database (com.h2database) - H2 database
  • Logging (org.slf4j) - Simple Logging Appearance for Java

When referring to the build directory, this tutorial assumes the standard Maven build path for your maven project:

Route describe
$mvnProject/src/main/java Java Source Directory
$mvnProject/src/main/resources Resource directory
$mvnProject/src/test/java Java Test Directory
$mvnProject/src/test/resources Resource Test Directory

You should be able to build a blank project. Before continuing, make sure that the overall status is "BUILD SUCCESS".

Command: mvn compile

Base path: $mvnProject

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building $quickStartJavaProjectName 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ $quickStartJavaProjectName ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ HelloProcess2 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.592s
[INFO] Finished at: Sun Nov 27 05:09:59 EST 2016
[INFO] Final Memory: 10M/309M
[INFO] ------------------------------------------------------------------------

Your output may look different, and most notably, maven may need to retrieve project dependencies.

Last article: Introduction

Posted by chamal on Wed, 02 Oct 2019 00:04:38 -0700