Camunda 创建springboot项目

Posted 正怒月神

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Camunda 创建springboot项目相关的知识,希望对你有一定的参考价值。

一 创建项目

打开:https://start.camunda.com/

填写如下,最后点击Generate Project按钮

二 修改数据库

1 数据库创建Camunda 

2 pom文件

只是将H2改为了mysql

<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>com.test</groupId>
  <artifactId>springboottest</artifactId>
  <version>1.0</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.6.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>7.17.0</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine-plugin-spin</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-all</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.6.4</version>
      </plugin>
    </plugins>
  </build>

</project>

三 application.yml

server:
  port: 8100

spring:
  application:
    name: spring-boot-test
  jackson:
    #设置返回前端的参数为驼峰的转换形式
    property-naming-strategy: SNAKE_CASE
    #日期格式化
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
  #数据源配置
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/camunda?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&autoReconnectForPools=true&noAccessToProcedureBodies=true&testOnBorrow=true&validationQuery=select 1
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: root
camunda:
  bpm:
    #配置账户密码来访问Camunda自带的管理界面
    admin-user:
      id: demo
      password: demo
      first-name: demo
    filter:
      create: All tasks
    #指定数据库类型
    database:
      type: mysql
      schema-update: true
    #禁止自动部署resources下面的bpmn文件
    auto-deployment-enabled: true
    #禁止index跳转到Camunda自带的管理界面,默认true
#    webapp:
#      index-redirect-enabled: false

四 启动运行

浏览器输入  localhost:8100

账号 demo

密码 demo

 

以上是关于Camunda 创建springboot项目的主要内容,如果未能解决你的问题,请参考以下文章

第三篇Camunda系列-整合SpringBoot

springboot集成camunda

第三篇Camunda系列-整合SpringBoot

第三篇Camunda系列-整合SpringBoot

使用 Spring Boot 和 mongodb 运行 camunda

001.camunda入门(springboot集成篇)