/ nice-and-handy

Camunda 7.9 Spring Boot using Gradle

Sometimes in projects I am faced with questions about process implementation or modeling options I cannot solve right away.

For this purpose I use a simple easy-to-use spring boot project to explore the possibilites right away. It runs on my localhost, starts fast and only contains a minimum amount of necessary classes.

process

Heres the new build.gradle, making camunda 7.9 work.

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'

buildscript {
	ext {
        springBootVersion = '2.0.2.RELEASE'
	}
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	}
}

repositories {
	mavenCentral()
}

dependencies {
	compile (group: 'org.camunda.bpm.springboot', name: 'camunda-bpm-spring-boot-starter', version: '3.0.0'){
		exclude module: 'spring-tx'
	}
	
	compile group: 'org.springframework', name: 'spring-tx', version: '5.0.6.RELEASE'
	
	compile group: 'org.camunda.bpm.springboot', name: 'camunda-bpm-spring-boot-starter-webapp', version: '3.0.0'
	compile group: 'org.camunda.bpm.springboot', name: 'camunda-bpm-spring-boot-starter-rest', version: '3.0.0'
	
	compile group: 'com.h2database', name: 'h2', version: '1.4.196'
}

I update this project every time a new major camunda version is released (every 6 months). Since I mostly work with gradle I adapt the given maven pom.

The adaption is sometimes a bit tricky. This time, the first approach resulted in an exception using plain:
plain

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceExceptionTranslationPostProcessor' defined in class path resource
[org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.
Caused by: java.lang.IllegalStateException: No persistence exception translators found in bean factory. Cannot perform exception translation.

I fixed it (see build.gradle above) following this hint on github:

tx

check out and run the code

https://github.com/stefanfrena/camunda/tree/master/standard-spring-boot
process

Let me know what you think.