Talend custom Maven build options - 7.3

Talend Software Development Life Cycle Best Practices Guide

EnrichVersion
7.3
EnrichProdName
Talend Big Data
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
EnrichPlatform
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend JobServer
Talend Studio
task
Administration and Monitoring
Deployment
Design and Development
Maven options you can pass when building, executing and publishing artifacts on your Continuous Integration server.
Talend leverages a standard Maven-based Continuous Integration (CI) implementation. A CI Maven command typically looks like this:
mvn \
        -f <project name>/poms/pom.xml \
        -am -pl <comma separated list of jobs modules> \
        -Dgeneration.type=local
        -Dlicense.path=<local path or url> \
        -Dupdatesite.path=<local path or url> \
        clean deploy
Example:
mvn -f C:/CI_CD/MYPROJECT/poms/pom.xml clean deploy -fn -e -pl jobs/process/priorTest_0.1 -am -Dlicense.path=C:/CI_CD/license -Dupdatesite.path=http://localhost:8080/P2/ -Dproject.distributionManagement.snapshotRepository.url=http://localhost:8081/repository/snapshots/ -Dproject.distributionManagement.snapshotRepository.id=snapshots -DaltDeploymentRepository=snapshots::default::http://localhost:8081/repository/snapshots/

Talend-related Maven parameters

Maven parameter Value
Talend CommandLine parameters -Dupdatesite.path URL address of your server where the P2 repository with Talend CommandLine can be downloaded and installed at build time. This site also contains the Maven plugins and all the external libraries necessary to build your pipelines. For an example of how to embed the P2 repository in your Tomcat application, see Before scheduling the execution of your artifacts.
Example:
-Dupdatesite.path=http://localhost:8080/P2/
Warning: This parameter only applies to users who have the P2 update site archive, which is provided by Talend.
-DforceUpdate (No value) Forces the installation of Talend CommandLine from the update site, even if a local installation is present.
-Dpatch.path Path to the patch you have installed or want to install (Talend Studio p2 patch, manual patch, component patch, etc.).
Example if you have installed the patch locally:
-Dpatch.path=D:/patches/Patch_TPS-2222.zip,D:/patches/Patch_TPS-3333.zip
Example of patch to download:
-Dpatch.path=http://localhost:8085/nexus/content/repositories/releases/Patch_TPS-2222.zip,http://localhost:8085/nexus/content/repositories/releases/Patch_TPS-3333.zip

If credentials are needed to access the remote patch location, use the -Dpatch.remote.user and -Dpatch.remote.password parameters. The patch.remote.password parameter can set a password encrypted by Maven.

-Dgeneration.type Type local as the value to generate the sources of your artifacts and Tests locally without having to keep the Talend CommandLine up and running during the build execution.
Example:
-Dgeneration.type=local

The server generation type is deprecated.

-Dlicense.path Path to the license of your Talend product.

If the licence path value is a URL and credentials are needed to access it, use the -Dlicense.remote.user and -Dlicense.remote.password parameters.

-Dcommandline.skip Type true as the value to skip the source code generation of your artifacts. This parameter can only be used if you have previously generated your artifacts using Talend CommandLine.
Example:
-Dcommandline.skip=true
-DprojectFilter Allows you to build only specific projects.
Example of filter on all projects with a name starting with CI:
-DprojectFilter="CI.*"
-DitemFilter Allows you to build only specific project items.

Example of filter on one specific Job with label job_dev:

-DitemFilter="label=job_dev"

Example of filter on all Jobs located in a sub-folder called Integration:

-DitemFilter="path=Integration"

Example of filter on all Jobs with TEST status:

-DitemFilter="(status=TEST)"

Example of filter on all Jobs with a name starting with jobExport, but that are not in the sandbox folder:

-DitemFilter="(!path=sandbox)and(label%jobExport*)"
-Dtalend.job.context and -Dtalend.job.applyContextToChildren When building or scheduling the execution of Jobs, specifies the context group to apply to all Jobs at build time.
Example to apply a context group named dev only to the parent Jobs and apply the default context group to the child Jobs:
-Dtalend.job.context=dev 
Example to apply a context group named dev to the parent Jobs and apply the same context group to the child Jobs:
-Dtalend.job.context=dev -Dtalend.job.applyContextToChildren=true 

If the context group you specify does not exist on the Job, the default context group will be applied.

Custom component parameters -Dcomponents.* When deploying Jobs that use custom components to an artifact repository, specifies the repository in which the component libraries are stored.
Example:
-Dcomponents.nexus.user=<user> 
-Dcomponents.nexus.password=<password> 
-Dcomponents.nexus.url=http://localhost:8081/
-Dcomponents.nexus.repository=talend-custom-libs-release 
-Dcomponents.nexus.repository.snapshot=talend-custom-libs-snapshot
Artifact repository parameter -DaltDeploymentRepository When deploying to an artifact repository (Nexus, Artifactory), specifies an alternative repository to which the project artifacts should be deployed.

Format: id::layout::url

Example:
-DaltDeploymentRepository=snapshots::default::http://localhost:8081/repository/snapshots/
Docker parameters -Ddocker.push.registry Specifies the Docker registry where you want to share your image.
-Ddocker.push.username Specifies the Docker user corresponding to the account that will log in to the Docker registry.

In the default script provided by Talend, the value corresponds to the ${env.Dusername} variable, that is the Docker user defined in the credentials stored in Jenkins.

-Ddocker.push.password Specifies the Docker password corresponding to the account that will log in to the Docker registry.

In the default script provided by Talend, the value corresponds to the ${env.Dpassword} variable, that is the Docker password defined in the credentials stored in Jenkins.

-Dtalend.docker.name Specifies the name of the Docker image that will be created.
-Dstudio.prometheus.metrics Add this parameter with a true value while publishing to Docker in order to expose Camel metrics to Prometheus and provide more details about the deployed Routes (number of processed exchanges, number of errors, requests per seconds, etc).
-Dtalend.project.branch Specifies the tag and related tagged artifacts you want to build.
Example:
-Dtalend.project.branch=tags/mytag
-Xms -Xmx JVM arguments that allow you to increase the memory available to Maven.
-Dstudio.talendDebug When trying to debug build issues with the support team for example, add this parameter with a true value to get additional logs.
Example:
-Dstudio.talendDebug=true