How to build integration flow packages containing additional Camel components
Pre-requirements
- installed Java JDK
- installed Maven
1) Download template pom.xml file
- inside the
<dependencies>
tags include Camel components needed for integration flow execution
1) correct dependency xml for each component can be found in Camel component reference
2) inside <version>
tags put ${camel.version}
property
3) example: FTP Component
```xml
<!-- Example: FTP component https://camel.apache.org/components/latest/ftp-component.html -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>${camel.version}</version>
</dependency>
</dependencies>
```
- inside the
<directory>
tags put correct path to your integration flow files directoryxml <resources> <resource> <!-- HERE: --> <!-- provide path to folder containg integration flow files --> <!-- [integration-flow.xml, metadata.json, xslt etc.] --> <directory>C:\dev\integration-flow-files</directory> </resource> </resources>
## 2) Open command prompt in directory where pom.xml is located
- execute command
mvn clean package
- after build succeeds a new
target
folder should be created withintegration-flow-0.1.0.jar
file inside - this file is ready for upload in the Integration Kit portal
Tip: Extracting content of a jar file
If you ever need to access files inside .jar package you can do so by opening a command prompt in folder where .jar file is located and using command jar xf integration-flow-0.1.0.jar
Java JDK + Maven
Java JDK
- install Java OpenJDK 11 https://adoptopenjdk.net/
- set JAVA_HOME environment variable
- verify that it installed correctly - open new command prompt and type
java -version
C:\Users\kzbrozek>java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
Maven
- download Maven
apache-maven-3.6.3-bin.zip
http://maven.apache.org/download.cgi - unzip to a folder
- set MAVEN_HOME environment variable
- edit
Path
envarionment variable and add%MAVEN_HOME%\bin
and%JAVA_HOME%\bin
- verify that it installed correctly: open new command prompt and type
mvn-version
C:\Users\kzbrozek>mvn -version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00)
Maven home: C:\dev\app\apache-maven-3.6.1\bin\..
Java version: 11.0.4, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-11.0.4.11-hotspot
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Tip: If you don't see expected result in command prompt try closing it and opening again