Camunda Project Template (Gradle)

I created a modular project template for camunda.

This splits your project into 3 gradle modules:

  • Process Application (your process)
  • Package WAR (builds the tomcat war deployment)
  • Package Boot (Spring Boot embedded process engine)

We can also add more package modules later on, but you can deploy the same process as a spring boot standalone service, run it in memory for testing or deploy it into a tomcat application server.

I would be happy over some feedback.

3 Likes

Updated it for camunda 7.9 - now also contains a boot aio build for local testing (with webapps and rest api).

3 Likes

Thanks for sharing this :slight_smile:

The project template is updated for camunda 7.10 :wink:

1 Like

I was happy to find this template using Gradle - thanks for sharing.
However, it took me some time and research to make it running. All bootRun* Gradle tasks failed with an error like

C:\camunda-template>gradlew bootRunWithLocalDb

> Task :camunda-template-package-boot:bootRun FAILED
Fehler: Hauptklasse application.CamundaProcessApplication konnte nicht gefunden oder geladen werden
Ursache: java.lang.ClassNotFoundException: application.CamundaProcessApplication

FAILURE: Build failed with an exception.
...

May I suggest three fixes (patch):

Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- build.gradle	(revision 2e31a6114a72ffcf9d99fb4454fb173b05e92fcf)
+++ build.gradle	(date 1587312378538)
@@ -20,6 +20,10 @@
         jcenter()
     }
 
+    jar {
+        enabled = true
+    }
+
     dependencyManagement {
         imports {
             mavenBom 'org.camunda.bpm:camunda-bom:7.10.0'
Index: package-war/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- package-war/build.gradle	(revision 2e31a6114a72ffcf9d99fb4454fb173b05e92fcf)
+++ package-war/build.gradle	(date 1587312378554)
@@ -41,7 +41,7 @@
 
 // Spring Boot
 springBoot {
-    mainClassName = 'application.Application'
+    mainClassName = 'application.CamundaProcessApplication'
 }
 
 // Cargo Configuration
Index: process-application/src/main/java/application/Application.java
===================================================================
--- process-application/src/main/java/application/Application.java	(revision 2e31a6114a72ffcf9d99fb4454fb173b05e92fcf)
+++ process-application/src/main/java/application/CamundaProcessApplication.java	(date 1587312378565)
@@ -16,7 +16,7 @@
 @Configuration
 @ComponentScan(basePackages = {"application"})
 @Slf4j
-public class Application extends SpringBootServletInitializer  {
+public class CamundaProcessApplication extends SpringBootServletInitializer  {
 
     /**
      * App EntryPoint
@@ -25,7 +25,7 @@
      * @throws Exception
      */
     public static void main(String[] args) throws Exception {
-        SpringApplication.run(Application.class, args);
+        SpringApplication.run(CamundaProcessApplication.class, args);
     }
 
     /**
@@ -36,7 +36,7 @@
      */
     @Override
     protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
-        return application.sources(Application.class);
+        return application.sources(CamundaProcessApplication.class);
     }
 
 }

many thanks & best regards