创建和设置Maven项目
创建一个名为“ActivitiDeveloperQuickStart”的Java项目(以下称为$quickStartJavaProjectName
),其中包含以下Maven依赖项:
文件:$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。
请注意以下依赖项:
- Activiti(
org.activiti
) — Activiti的BPM引擎 - 数据库(
com.h2database
) — H2数据库 - 日志记录(
org.slf4j
) — Simple Logging Facade for Java
在引用构建目录时,本教程假定你的maven项目的标准Maven构建路径:
路径 | 描述 |
---|---|
$mvnProject /src/main/java |
Java源目录 |
$mvnProject /src/main/resources |
Resource目录 |
$mvnProject /src/test/java |
Java测试目录 |
$mvnProject /src/test/resources |
Resource测试目录 |
你应该能够构建空白项目,在继续之前,请确保整体状态为“BUILD SUCCESS”。
命令:mvn compile
基础路径:$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] ------------------------------------------------------------------------
你的输出可能看起来不同,最值得注意的是,maven可能需要检索项目依赖项。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。