使用camunda开源工作流引擎有多种方式,包括:通过docker运行、使用springboot集成、部署camunda发行包、基于源代码编译运行等多种方式,其中,通过源代码编译集成整合方式,是最复杂的一种方式,文本重点介绍如何通过camunda7.19源代码编译,集成整合到自己的项目工程里。
1、下载camunda源代码
camunda开源github下载地址:https://github.com/camunda/camunda-bpm-platform
我选择camunda最后一个可支持JDK1.8的稳定版本camunda7.19
camunda-bpm-platform-7.19.0版本的下载地址:
https://github.com/camunda/camunda-bpm-platform/releases/tag/7.19.0
2、编译camunda源代码
下载下来是一个20多M的zip压缩包,直接解压即可。
Camunda7.19源代码核心包说明:
maven工程名称 | 说明 |
camunda-database-settings | camunda支持的各种数据库定义 |
camunda-engine | Camunda BPMN流程引擎核心包 |
camunda-engine-dmn | Camunda dmn引擎核心包 |
camunda-engine-plugins | camunda支持的插件包 |
camunda-engine-rest-core | camunda发布rest服务的核心包 |
camunda-engine-spring | camunda集成spring框架的包 |
camunda-model-apis | camunda中各种模型API接口包 |
camunda-parent | Camunda maven工程父包,主要定义第三方Jar包版本 |
camunda-qa | camunda与各种环境的集成测试包 |
camunda-bpm-spring-boot-starter | camunda集成springboot框架的包 |
camunda-webapp | camunda发布web程序构建包 |
webapps\frontend | camunda的前端代码包,基于angular开发 |
首先要编译源代码,要确保下载的源代码可编译通过,建议使用maven命令行编译运行,这个时间预计1个小时左右,跟你的网络有关系,也可能有的包下载不下来失败,可多尝试几次。
我本地使用的Java jdk版本是java version "11.0.6",maven版本是Apache Maven 3.8.2,理论上jdk1.8版本以上都可以。
使用命令行cd到camunda-bpm-platform-7.19.0根目录下,使用maven命令执行编译:
mvn clean install -DskipTests=true
由于camunda源代码中有大量的测试用例,编译比较耗时,这里通过-DskipTests=true命令跳过测试用例执行。
注意:以下几个module执行涉及到第三方Jar包下载不了可能会报错,这几个跟Javaee相关的集成模块可以pom.xml中注释掉,不影响后续使用。
<module>javaee/ejb-service</module>
<module>javaee/ejb-client</module>
<module>javaee/ejb-client-jakarta</module>
<module>javaee/jobexecutor-ra</module>
<module>javaee/jobexecutor-rar</module>
我们也不会使用camunda的web前端,webapps也可注释掉。
<module>webapps</module>
最后执行mvn clean install -DskipTests=true成功的结果:
[INFO] Reactor Summary for Camunda Platform - Root Pom 7.19.0:[INFO][INFO] Camunda Platform - Root Pom ........................ SUCCESS [ 2.687 s][INFO] Camunda Platform - Parent Pom ...................... SUCCESS [ 0.000 s][INFO] Camunda Platform - database settings ............... SUCCESS [ 0.032 s][INFO] camunda Model APIs ................................. SUCCESS [ 0.031 s][INFO] Camunda Platform - Xml Model API ................... SUCCESS [ 6.407 s][INFO] Camunda Platform - ArchUnit ........................ SUCCESS [ 0.954 s][INFO] Camunda Platform - BPMN Model API .................. SUCCESS [ 12.806 s][INFO] Camunda Platform - CMMN Model API .................. SUCCESS [ 5.918 s][INFO] camunda Commons - Typed Values ..................... SUCCESS [ 5.595 s][INFO] Camunda Platform - DMN Model API ................... SUCCESS [ 5.078 s][INFO] camunda DMN - engine - root ........................ SUCCESS [ 0.062 s][INFO] camunda DMN - engine FEEL - API .................... SUCCESS [ 0.739 s][INFO] camunda DMN - engine FEEL - JUEL ................... SUCCESS [ 8.282 s][INFO] camunda DMN - engine FEEL - SCALA .................. SUCCESS [ 1.516 s][INFO] camunda DMN - engine ............................... SUCCESS [ 3.933 s][INFO] Camunda Test Utils - Testcontainers ................ SUCCESS [ 0.773 s][INFO] Camunda Platform - engine .......................... SUCCESS [02:14 min][INFO] Camunda Platform - engine - Spring ................. SUCCESS [ 3.640 s][INFO] Camunda Platform - engine plugins .................. SUCCESS [ 0.086 s][INFO] Camunda Platform - engine plugins - spin ........... SUCCESS [ 1.106 s][INFO] Camunda Platform - engine plugins - connect ........ SUCCESS [ 0.267 s][INFO] Camunda Platform - Assert - Root ................... SUCCESS [ 0.048 s][INFO] Camunda Platform - Assert .......................... SUCCESS [ 0.852 s][INFO] Camunda Platform - Spring Boot Starter - Root Pom .. SUCCESS [ 0.734 s][INFO] Camunda Platform - Spring Boot Starter - Test ...... SUCCESS [ 0.714 s][INFO] Camunda Platform - Spring Boot Starter ............. SUCCESS [ 4.950 s][INFO] Camunda Platform - Bom ............................. SUCCESS [ 0.077 s][INFO] Camunda Platform - Core - Internal Dependencies .... SUCCESS [ 0.040 s][INFO] Camunda Platform - engine - REST - Root ............ SUCCESS [ 0.036 s][INFO] Camunda Platform - engine - REST ................... SUCCESS [ 8.516 s][INFO] Camunda Platform - Spring Boot Starter - Rest ...... SUCCESS [ 0.283 s][INFO] Camunda Platform - Java External Task Client - ROOT SUCCESS [ 0.050 s][INFO] Camunda Platform - Java External Task Client - QA .. SUCCESS [ 0.051 s][INFO] Camunda Platform - Java External Task Client - QA VARIABLE TEST SUCCESS [ 2.222 s][INFO] Camunda Platform - engine - Cdi .................... SUCCESS [ 10.352 s][INFO] Camunda Platform - engine plugins - identity - ldap SUCCESS [ 0.704 s][INFO] Camunda Platform - License Book .................... SUCCESS [ 1.496 s][INFO] Camunda Platform - tomcat .......................... SUCCESS [ 0.044 s][INFO] Camunda Platform - tomcat Assembly ................. SUCCESS [ 15.426 s][INFO] Camunda Platform - engine - REST - Assembly ........ SUCCESS [ 7.909 s][INFO] Camunda Platform - Java External Task Client - CLIENT SUCCESS [ 2.110 s][INFO] Camunda Platform - Spring Boot Starter - Client - Spring SUCCESS [ 0.397 s][INFO] Camunda Platform - Spring Boot Starter - Client - Spring Boot SUCCESS [ 0.493 s][INFO] Camunda Platform - Spring Boot Starter - QA - Root Pom SUCCESS [ 0.085 s][INFO] Camunda Platform - Spring Boot Starter - QA - Simple SUCCESS [ 0.142 s][INFO] Camunda Platform - Spring Boot Starter - QA - Request Scope SUCCESS [ 0.144 s][INFO] Camunda Platform - Spring Boot Starter - QA - Plugins SUCCESS [ 0.046 s][INFO] Camunda Platform - Spring Boot Starter - QA - Plugins - Spin SUCCESS [ 0.033 s][INFO] Camunda Platform - Spring Boot Starter - QA - Plugins - Spin Json Jackson SUCCESS [ 0.204 s][INFO] Camunda Platform - Spring Boot Starter - QA - Plugins - Spin All SUCCESS [ 0.144 s][INFO] Camunda Platform - Spring Boot Starter - QA - Liquibase SUCCESS [ 0.250 s][INFO] Camunda Platform - webapp - webjar ................. SUCCESS [ 7.726 s][INFO] Camunda Platform - Spring Boot Starter - Webapps Core SUCCESS [ 0.291 s][INFO] Camunda Platform - Spring Boot Starter - Webapps ... SUCCESS [ 0.203 s][INFO] Camunda Platform - Example - Root .................. SUCCESS [ 0.053 s][INFO] Camunda Platform - Example - Invoice ............... SUCCESS [ 0.559 s][INFO] Camunda Platform - Spring Boot Starter - QA - Webapps SUCCESS [ 0.031 s][INFO] Camunda Platform - Spring Boot Starter - QA - Webapps Invoice Example SUCCESS [ 0.156 s][INFO] Camunda Platform - Spring Boot Starter - QA - Webapps Runtime SUCCESS [ 0.094 s][INFO] Camunda Platform - Quarkus Extension - Parent ...... SUCCESS [ 0.048 s][INFO] Camunda Platform - Quarkus Extension - Engine - Parent SUCCESS [ 0.046 s][INFO] Camunda Platform - Quarkus Extension - Engine - Runtime SUCCESS [ 1.784 s][INFO] Camunda Platform - Quarkus Extension - Engine - Deployment SUCCESS [ 1.618 s][INFO] Camunda Platform - Quarkus Extension - Engine - CDI QA SUCCESS [ 0.427 s][INFO] Camunda Platform - QA .............................. SUCCESS [ 0.046 s][INFO] Camunda Platform - QA - ensure clean db plugin ..... SUCCESS [ 0.117 s][INFO] Camunda Platform - QA Wildfly Test Runtime ......... SUCCESS [ 0.433 s][INFO] Camunda Platform - QA Wildfly 26 Test Runtime ...... SUCCESS [ 0.396 s][INFO] Camunda Platform - QA Tomcat Test Runtime .......... SUCCESS [ 0.050 s][INFO] Camunda Platform - QA Tomcat Vanilla Test Runtime .. SUCCESS [ 0.046 s][INFO] Camunda Platform - QA Wildfly Vanilla Test Runtime . SUCCESS [ 0.032 s][INFO] Camunda Platform - QA Wildfly 26 Vanilla Test Runtime SUCCESS [ 0.033 s][INFO] Camunda Platform - QA Integration Tests - Webapps Root SUCCESS [ 2.216 s][INFO] Camunda Platform - QA Integration Tests - Webapps ITs SUCCESS [ 0.698 s][INFO] Camunda Platform - Client .......................... SUCCESS [ 0.119 s][INFO] Camunda Platform - QA Integration Tests - Engine ... SUCCESS [ 4.576 s][INFO] Camunda Platform - EJB Client Jakarta .............. SUCCESS [ 1.170 s][INFO] Camunda Platform - engine - Cdi - Jakarta .......... SUCCESS [ 2.891 s][INFO] Camunda Platform - QA Integration Tests - Engine - Jakarta SUCCESS [ 5.385 s][INFO] Camunda Platform - QA - upgrade - database ......... SUCCESS [ 0.094 s][INFO] Camunda Platform - QA - upgrade - scenario util .... SUCCESS [ 0.250 s][INFO] Camunda Platform - QA - upgrade - instance migration SUCCESS [ 0.062 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.2.0 SUCCESS [ 1.390 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.3.0 SUCCESS [ 0.438 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.4.0 SUCCESS [ 0.172 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.5.0 SUCCESS [ 0.312 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.6.0 SUCCESS [ 0.328 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.7.0 SUCCESS [ 0.375 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.8.0 SUCCESS [ 0.485 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.9.0 SUCCESS [ 0.484 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.10.0 SUCCESS [ 0.641 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.11.0 SUCCESS [ 0.312 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.12.0 SUCCESS [ 0.844 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.13.0 SUCCESS [ 0.609 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.14.0 SUCCESS [ 0.828 s][INFO] Camunda Platform - QA - upgrade - instance migration - test fixture - 7.15.0 SUCCESS [ 0.859 s][INFO] camunda BPM - QA - upgrade - instance migration - test fixture - 7.16.0 SUCCESS [ 0.844 s][INFO] camunda BPM - QA - upgrade - instance migration - test fixture - 7.17.0 SUCCESS [ 0.640 s][INFO] camunda BPM - QA - upgrade - instance migration - test fixture - 7.18.0 SUCCESS [ 0.469 s][INFO] camunda BPM - QA - upgrade - instance migration - test fixture - 7.19.0 SUCCESS [ 0.172 s][INFO] Camunda Platform - QA - upgrade - instance migration - test SUCCESS [ 0.516 s][INFO] Camunda Platform - QA - upgrade - rolling update ... SUCCESS [ 0.054 s][INFO] Camunda Platform - QA - upgrade - rolling update util SUCCESS [ 0.133 s][INFO] Camunda Platform - QA - upgrade - rolling update - create old engine SUCCESS [ 0.219 s][INFO] Camunda Platform - QA - upgrade - rolling update - create new engine SUCCESS [ 0.187 s][INFO] Camunda Platform - QA - upgrade - rolling update - test old engine SUCCESS [ 0.203 s][INFO] Camunda Platform - QA - test new schema with old engine SUCCESS [ 0.063 s][INFO] Camunda Platform - QA Performance Tests Engine ..... SUCCESS [ 9.141 s][INFO] Large Data Tests ................................... SUCCESS [ 0.203 s][INFO] camunda DMN - engine - bom ......................... SUCCESS [ 0.031 s][INFO] Camunda Platform - JUnit 5 Extension ............... SUCCESS [ 0.242 s][INFO] Camunda Platform - QA - Assert ..................... SUCCESS [ 0.141 s][INFO] Camunda Platform - engine - Cdi - Compatbility Test Weld 3 SUCCESS [ 0.443 s][INFO] Camunda Platform - engine - CDI - Root ............. SUCCESS [ 0.041 s][INFO] Camunda Platform - engine - Compatbility Test Spring 4 SUCCESS [ 0.328 s][INFO] Camunda Platform - engine - Spring - Root .......... SUCCESS [ 0.032 s][INFO] Camunda Platform - engine - REST - OpenAPI (JSON Generator) SUCCESS [ 0.109 s][INFO] Camunda Platform - engine - REST - OpenAPI ......... SUCCESS [ 41.661 s][INFO] Camunda Platform - engine - REST Jakarta ........... SUCCESS [01:28 min][INFO] Camunda Platform - engine - REST - Assembly Jakarta SUCCESS [ 2.850 s][INFO] Camunda Platform - Example - Invoice Jakarta ....... SUCCESS [ 2.167 s][INFO] Camunda Platform - JBoss ........................... SUCCESS [ 0.019 s][INFO] Camunda Platform - webapp - JBoss .................. SUCCESS [ 5.335 s][INFO] Camunda Platform - webapp - JBoss Standalone ....... SUCCESS [ 8.444 s][INFO] Camunda Platform - SQL scripts ..................... SUCCESS [ 15.140 s][INFO] Camunda Platform - webapp - Tomcat ................. SUCCESS [ 3.849 s][INFO] Camunda Platform - tomcat Distro ................... SUCCESS [ 39.697 s][INFO] Camunda Platform - webapp - Tomcat Standalone ...... SUCCESS [ 7.264 s][INFO] Camunda Platform - Run - Root ...................... SUCCESS [ 0.022 s][INFO] Camunda Platform - Run - Modules ................... SUCCESS [ 0.038 s][INFO] Camunda Platform - Run - Module REST ............... SUCCESS [ 12.390 s][INFO] camunda Platform - Run - Module Swagger UI ......... SUCCESS [17:24 min][INFO] Camunda Platform - Run - Module Example Invoice .... SUCCESS [ 8.375 s][INFO] Camunda Platform - Run - Core ...................... SUCCESS [ 9.920 s][INFO] Camunda Platform - Run - Assembly .................. SUCCESS [ 9.158 s][INFO] Camunda Platform - Run - QA ........................ SUCCESS [ 0.029 s][INFO] Camunda Platform - Run - QA - Integration Tests .... SUCCESS [12:17 min][INFO] Camunda Platform - Run - Module Webapps ............ SUCCESS [ 0.308 s][INFO] Camunda Platform - Run - Distribution .............. SUCCESS [ 30.881 s][INFO] Camunda Platform - Run - QA - Runtime .............. SUCCESS [ 0.566 s][INFO] Camunda Platform - Wildfly ......................... SUCCESS [ 0.056 s][INFO] Camunda Platform - Wildfly Subsystem ............... SUCCESS [ 26.416 s][INFO] Camunda Platform - Wildfly Modules ................. SUCCESS [ 15.832 s][INFO] Camunda Platform - Wildfly Assembly ................ SUCCESS [01:23 min][INFO] Camunda Platform - webapp - WildFly ................ SUCCESS [ 9.859 s][INFO] Camunda Platform - Wildfly Distro .................. SUCCESS [01:34 min][INFO] Camunda Platform - Wildfly 26 ...................... SUCCESS [ 0.043 s][INFO] Camunda Platform - Wildfly 26 Subsystem ............ SUCCESS [ 28.524 s][INFO] Camunda Platform - Wildfly 26 Modules .............. SUCCESS [ 22.495 s][INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 44:25 min[INFO] Finished at: 2024-02-17T13:45:01+08:00[INFO] ---------------------------------------------------------------------
这是在我本地笔记本上编译的结果,用了44分钟完成了camunda7.19源代码的编译和打包。
流程在线体验系统:http://www.yunchengxc.com
camunda源代码:https://github.com/camunda/camunda-bpm-platform
接下来,我们需要分析Camunda 源代码工程结构,Camunda 7.19一共有178个maven工程和1个angular前端工程。
下一篇:camunda源代码编译运行(二):构建并运行camunda源代码工程