Activiti指南(建立和設置Maven項目)

建立和設置Maven項目

建立一個名爲「ActivitiDeveloperQuickStart」的Java項目(如下稱爲$quickStartJavaProjectName),其中包含如下Maven依賴項:java

文件:$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>

固然,$actVer將替換爲下載的Activiti版本,例如,若是你下載的Activiti軟件包是「activiti-5.22.0」,那麼$actVer的值將是5.22.0。apache

請注意如下依賴項:segmentfault

  • Activiti(org.activiti) — Activiti的BPM引擎
  • 數據庫(com.h2database) — H2數據庫
  • 日誌記錄(org.slf4j) — Simple Logging Facade for Java

在引用構建目錄時,本教程假定你的maven項目的標準Maven構建路徑:api

路徑 描述
$mvnProject/src/main/java Java源目錄
$mvnProject/src/main/resources Resource目錄
$mvnProject/src/test/java Java測試目錄
$mvnProject/src/test/resources Resource測試目錄

你應該可以構建空白項目,在繼續以前,請確保總體狀態爲「BUILD SUCCESS」。maven

命令:mvn compile測試

基礎路徑:$mvnProjectui

[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] ------------------------------------------------------------------------
你的輸出可能看起來不一樣,最值得注意的是,maven可能須要檢索項目依賴項。

上一篇:介紹

相關文章
相關標籤/搜索