Skip to main content

Version: 20.11 (EOL)

Project Build Files

Journey SDK provides an Ant-based project build system to support application development, CI/CD processes and Maestro SCM integration. This build system is designed to work well in both developer IDEs and on CI servers.

Project Layout

Standard Project Layout

Journey platform development is performed in projects which have the following standard project layout structure and Ant build files.

project
  • imports — Directory. Contains shared library source code.
  • src — Directory. Contains the application source code.
  • target — Directory. Contains the output build artifacts.
  • build.xml — File. Provides the Ant development targets (tasks).
  • build.properties — File. Provides project specific Ant configuration properties.
  • transact-auth.properties — File. Provides the Journey Manager server authentication credentials and URLs.
  • proxy.properties — File. Provides optional proxy server connection properties.

Maven Project Layout

Journey platform development is performed in projects which have the following basic Maven layout structure and Ant build files.

project
  • src
    • imports
      • groovy — Directory. Contains shared library source code and resources.
    • main
      • groovy — Directory. Contains the application source code.
      • resources — Directory. Contains the application resources.
    • test
      • groovy — Directory. Contains the test source code.
      • resources — Directory. Contains the test resources.
    • target — Directory. Contains the output build artifacts.
    • build.xml — File. Provides the Ant development targets (tasks).
    • build.properties — File. Provides project specific Ant configuration properties.
    • pom.xml — File. Provides the Maven POM library dependencies.
    • proxy.properties — File. Provides optional proxy server connection properties.
    • transact-auth.properties — File. Provides the Journey Manager server authentication credentials and URLs.

Ant Build

SDK Libraries

To run the Ant build tasks you need to configure your IDE or CI server to reference all the Journey SDK library JAR files. These JAR files are contained in the Journey SDK distribution folders shown below.

transact-sdk
  • lib

When running the Ant tasks in a CI context these libraries can be specified on the Ant process command line. An example app-package task command line is shown below.

ant -lib ../transact-sdk-19.5.0/lib app-package

Ant Build File

An Ant build.xml project file is shown below.

This build file references the following property files to externalize a number of configuration items.

note

The build file must include the <taskdef> elements to make the Journey SDK Ant tasks available for use in for your project.

<?xml version="1.0" encoding="utf-8"?>
<project name="PROJECT-NAME" basedir=".">
<taskdef resource="com/avoka/transact/ant/antlib.xml"/>
<property file="build.properties"/>
<property file="transact-auth.properties"/>
<target name="clean">
<delete dir="target"/>
</target>
<!-- Application Package Tasks -->
<target name="app-get">
<app-get clientCode="${manager.clientCode}"
name="${app.name}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
dir="${manager.downloads}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="app-delete">
<app-delete clientCode="${manager.clientCode}"
name="${app.name}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="app-deploy" depends="app-test">
<app-deploy file="${app.zip.file}"
clientCode="${manager.clientCode}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="app-scaffold">
<app-scaffold name="${app.name}"
formCode="${app.formCode}"
version="${version}"
clientCode="${manager.clientCode}"
dir="${basedir}/src" />
</target>
<target name="app-scaffold-connect">
<input message="Please enter Service Connection Name:"
addproperty="name" />
<app-scaffold-connect
name="${name}"
dir="${basedir}/src" />
</target>
<target name="app-scaffold-form">
<input message="Please enter Form Name:"
addproperty="formName" />
<input message="Please enter Form Code (max 20 chars)"
addproperty="formCode" />
<app-scaffold-form
formName="${formName}"
formCode="${formCode}"
version="${version}"
clientCode="${manager.clientCode}"
dir="${basedir}/src" />
</target>
<target name="app-scaffold-func">
<input message="Please enter Function Name:"
addproperty="name" />
<input message="Please enter Package Name:"
addproperty="packageName"/>
<input message="Please select function type:"
validargs="Fluent Function,Delivery Function"
addproperty="template"
defaultvalue="Fluent Function" />
<input message="Please select function trigger:"
validargs="Form Open,Form Resume,Form Update,Form Ineligible,Form Function,User Save,User Submit,User Cancel,Background Delivery"
addproperty="trigger"
defaultvalue="Form Update"/>
<app-scaffold-func
template="${template}"
trigger="${trigger}"
name="${name}"
packageName="${packageName}"
formCode="${app.formCode}"
version="${version}"
clientCode="${manager.clientCode}"
dir="${basedir}/src" />
</target>
<target name="app-package" depends="svc-typecheck">
<app-package src="${basedir}/src/app-package-def.json"
file="${app.zip.file}" />
</target>
<target name="app-svc-test" depends="app-package">
<app-svc-test appfile="${basedir}/${app.zip.file}" />
</target>
<target name="app-test" depends="app-svc-test">
<app-test appfile="${basedir}/${app.zip.file}"
logOnError="true"
consoleLogging="false" >
<fileset dir="${basedir}/src/tests/">
<include name="*test-suite-*.json"/>
</fileset>
</app-test>
</target>
<!-- Gen Tasks -->
<target name="gen-vo">
<input message="Specify the source form XML seed file: "
defaultvalue="src/forms/homeloan/formdata.xml"
addproperty="input"/>
<input message="Specify the target entity XPath: "
defaultvalue="//Applicant"
addproperty="xpath"/>
<input message="Please enter Package Name:"
addproperty="packageName"/>
<gen-vo src="${input}"
packageName="${packageName}"
dir="${basedir}/src/"
targetXPath="${xpath}" />
</target>
<!-- Service Tasks -->
<target name="svc-clone">
<input message="Please enter Service Name:" addproperty="serviceName"/>
<input message="Please enter Service Version:" addproperty="serviceVersion"/>
<svc-clone clientCode="${manager.clientCode}"
name="${serviceName}"
version="${serviceVersion}"
dir="${basedir}/src"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="svc-delete">
<svc-delete src="${basedir}/src"
name="${svc.name}"
version="${version}"
clientCode="${manager.clientCode}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="svc-deploy">
<svc-deploy file="${svc.zip.file}"
clientCode="${manager.clientCode}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="svc-helpdoc">
<svc-helpdoc>
<fileset dir="${basedir}/src">
<include name="**/service-def.json"/>
</fileset>
</svc-helpdoc>
</target>
<target name="svc-imports">
<svc-imports>
<fileset dir="${basedir}/src">
<include name="**/service-def.json"/>
</fileset>
</svc-imports>
</target>
<target name="svc-package" depends="svc-typecheck, clean">
<svc-package file="${svc.zip.file}"
src="${basedir}/src"
debug="false">
<fileset dir="${basedir}/src">
<include name="**/service-def.json"/>
</fileset>
</svc-package>
</target>
<target name="svc-scaffold">
<input message="Please enter Service Name:"
addproperty="name"/>
<input message="Please enter Package Name:"
addproperty="packageName"/>
<input message="Please enter Service Template:"
validargs="Delivery Function,Fluent Function,Delivery Function,Fluent Function,Fluent Delivery Process,..."
addproperty="template"/>
<svc-scaffold
template="${template}"
name="${name}"
packageName="${packageName}"
version="${version}"
dir="${basedir}/src"/>
</target>
<target name="svc-scaffold-legacy">
<input message="Please enter Service Name:"
addproperty="name"/>
<input message="Please enter Package Name:"
addproperty="packageName"/>
<input message="Please enter Legacy Groovy Service Template:"
validargs="Groovy Delivery Process,Groovy Dynamic Data,Groovy Email Service,Groovy Form Prefill,Groovy Form Saved Processor,..."
addproperty="template"/>
<svc-scaffold
template="${template}"
name="${name}"
packageName="${packageName}"
version="${version}"
dir="${basedir}/src"/>
</target>
<target name="svc-test" depends="svc-package">
<svc-test clientCode="${manager.clientCode}">
<fileset dir="target">
<include name="*.zip"/>
</fileset>
</svc-test>
</target>
<target name="svc-test-remote">
<svc-test-remote src="${basedir}/src"
name="${svc.name}"
clientCode="${manager.clientCode}"
url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
junitXmlReport="target/TEST-junit.xml"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="svc-typecheck" depends="svc-imports">
<svc-typecheck src="${basedir}/src">
<fileset dir="${basedir}/src">
<include name="**/service-def.json"/>
</fileset>
</svc-typecheck>
</target>
<!-- SCM Tasks -->
<target name="scm-clone">
<scm-clone url="${maestro.url}"
username="${maestro.username}"
password="${maestro.password}"
clone="${scm.clone}"
dir="${scm.src.dir}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="scm-diff">
<scm-diff url="${maestro.url}"
username="${maestro.username}"
password="${maestro.password}"
clone="${scm.clone}"
dir="${scm.src.dir}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="scm-pull">
<scm-pull url="${maestro.url}"
username="${maestro.username}"
password="${maestro.password}"
clone="${scm.clone}"
dir="${scm.src.dir}"
proxyFile="${basedir}/proxy.properties" />
</target>
<target name="scm-push">
<scm-push url="${maestro.url}"
username="${maestro.username}"
password="${maestro.password}"
clone="${scm.clone}"
dir="${scm.src.dir}"
proxyFile="${basedir}/proxy.properties" />
</target>
</project>

Build Properties File

An example build.properties file is shown below.

#=================
# Build Properties
#=================
# Application Package & Service Version
version=0.1.0
#-----------------------
# Application Properties
#-----------------------
# Application Package Name
app.name=PROJECT-NAME
# Application Package Form Code
app.formCode=homeloan
# Application Package Archive ZIP file
app.zip.file=target/app-home-loan-v${version}.zip
#-------------------
# Service Properties
#-------------------
# Service Name (enable building single service instead of all services in "src" folder)
#svc.name=Hello World
# Service Archive ZIP file
svc.zip.file=target/services-v${version}.zip
#-----------------
# SCM Properties
#-----------------
# SCM Clone Command for Form Design Versions (scm-clone)
# scm.clone=scm design clone maguire/retail-products/forms/home-loan/1.0-develop
# SCM Source Directory
scm.src.dir=src/maestro
#-----------------
# SCM Library Export/Import Support
#-----------------
# Project Name (if a project library)
scm.lib.projectName=
# Library Name
scm.lib.libraryName=
# Library Version
scm.lib.versionNumber=
# Library file path to export/import
scm.lib.file=
# Library dir path to export/import
scm.lib.dir=
# Library update strategy. If merge is set to true, any existing files not in the new library will be preserved.
# Otherwise all existing library files will be removed, and only the new library files will be added.
scm.lib.merge=false

Journey Auth Properties File

An example transact-auth.properties file is shown below.

note

As a general rule, don't check this file into source control as it may contain sensitive user credentials.

On CI servers such as Jenkins, Bamboo or TeamCity these properties would be managed by the CI sever's configuration management features.

#=========================
# Journey Auth Properties
#=========================
# Warning: Do not use quotes to delimit property values - use naked strings only.
# Correct: manager.clientCode=my-org
# Incorrect: manager.clientCode="my-org"
#-----------------
# Journey Manager
#-----------------
# Journey Manager URL E.g.
# https://transact.yourdomain.com/manager/
manager.url=http://localhost:9080/manager/
# REST User Login Name
manager.username=administrator
# REST User Password
manager.password=password
# Organization Client Code - located on the Organizations page in Journey Manager
manager.clientCode=maguire
#-----------------
# Journey Maestro
#-----------------
# Journey Maestro URL E.g.
# US: https://maestro.avoka.com/maestro/
# EU: https://maestro.avoka.eu/maestro/
# AU: https://maestro.avoka.com.au/maestro/
maestro.url=
# Maestro Login Username
maestro.username=
# Maestro Login Password
maestro.password=
# Maestro Client Code - located on the organization page title in Maestro
maestro.clientCode=maguire

Proxy Properties File

An example proxy.properties file is shown below.

#======================
# HTTP Proxy Properties
#======================
# - settings will be used if "http.proxyHost" value is not blank
# - NTLM configuration will be used if "http.proxyDomain" value is not blank
# - username/password values will be used if "http.proxyUser" value is not blank
## HTTP Proxy host. e.g "proxy.mycompany.com"
http.proxyHost=
## HTTP Proxy port. e.g "8080"
http.proxyPort=
## HTTP Proxy domain. e.g "MYCOMPANY"
http.proxyDomain=
## HTTP Proxy workstation. e.g "workstation"
http.proxyWorkstation=
## HTTP Proxy user. e.g "jhondoe"
http.proxyUser=
## HTTP Proxy user. e.g "password"
http.proxyPassword=