Defining the Maven options to build your project - 7.3

Talend Software Development Life Cycle Best Practices Guide

Version
7.3
Language
English (United States)
Product
Talend Big Data
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Module
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend JobServer
Talend Studio
Content
Administration and Monitoring
Deployment
Design and Development

You have the possibility to adapt the Maven build command to fit your deployment needs. Here are some examples of commands:

  • To build, test, package artifacts of the CICD project as .jar or .zip files and deploy them to the Nexus snapshots repository :
    options: '-f <ProjectName>/poms/pom.xml 
    -s <PathToDirectory>/maven_settings.xml 
    -Dproduct.path=<CommandLinePath> 
    -Dlicense.path=<PathToDirectory>/license 
    -Dupdatesite.path=<updatesiteURL> 
    -Dpatch.path=<patchPath> 
    -DaltDeploymentRepository=snapshots::default::http://XXX:8081/repository/snapshots/ 
    -fae 
    -e'
    goals: 'deploy'
    • Groovy script example:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dproduct.path=/home/talend/talend_studio 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip 
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'''
      goals: 'deploy'
      Note: Read the Groovy syntax documentation for more information on supported formats for multiline strings.
    • Yaml script example:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dproduct.path=/home/talend/talend_studio 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip 
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'
      goals: 'deploy'
      Note: Read the YAML syntax documentation for more information on supported formats for multiline strings.
    Example with a Job that uses custom components (additional parameters are required to point to the artifact repository in which the custom components are stored):
    • Groovy script example:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/sample_0.1 
      -am  
      -Dcomponents.nexus.user=username 
      -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
      -Dproduct.path=/home/talend/talend_studio
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae -e'''
      goals: 'deploy'
      Note: Read the Groovy syntax documentation for more information on supported formats for multiline strings.
    • Yaml script example:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/sample_0.1 
      -am  
      -Dcomponents.nexus.user=username 
      -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
      -Dproduct.path=/home/talend/talend_studio
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae -e'
      goals: 'deploy'
      Note: Read the YAML syntax documentation for more information on supported formats for multiline strings.
    Example with a Job that uses context groups:
    • Groovy script example:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/parent_0.1 
      -am  
      -Dproduct.path=/home/talend/talend_studio
      -Dlicense.path=/home/talend/talend_studio/license
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip
      -Dtalend.job.context=dev 
      -Dtalend.job.applyContextToChildren=true 
      -fae -e'''
      goals: 'deploy'
      Note: Read the Groovy syntax documentation for more information on supported formats for multiline strings.
    • Yaml script example:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/parent_0.1 
      -am  
      -Dproduct.path=/home/talend/talend_studio
      -Dlicense.path=/home/talend/talend_studio/license
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/Patch_TPS-2222.zip
      -Dtalend.job.context=dev 
      -Dtalend.job.applyContextToChildren=true 
      -fae -e'
      goals: 'deploy'
      Note: Read the YAML syntax documentation for more information on supported formats for multiline strings.
    Note: If the context group you specify does not exist on the Job, the default context group will be applied.
  • To build, clean, test, package artifacts of the CICD project as .jar or .zip files and deploy them to a Docker registry :
    options: '-f <ProjectName>/poms/pom.xml 
    -s <PathToDirectory>/maven_settings.xml 
    -Dproduct.path=<CommandLinePath> 
    -Dlicense.path=<PathToDirectory>/license 
    -Dupdatesite.path=<updatesiteURL> 
    -Dpatch.path=<patchPath> 
    -Ddocker.push.registry=<DockerRegistryName> 
    -Ddocker.push.username=<Dockerusername> 
    -Ddocker.push.password=<DockerPassword> 
    -Dtalend.docker.name=<DockerImageName> 
    -Xms1024m 
    -Xmx3096m'
    goals: 'clean deploy'
    • Groovy script example:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dproduct.path=/home/talend/talend_studio 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/updateXXX.zip 
      -Ddocker.push.registry=registry.example.com/group/project 
      -Ddocker.push.username=TalendUser 
      -Ddocker.push.password=V3ryCompl3xPwd 
      -Dtalend.docker.name=cicd4talend 
      -Xms1024m 
      -Xmx3096m'''
      goals: 'clean deploy'
      Note: Read the Groovy syntax documentation for more information on supported formats for multiline strings.
    • Yaml script example:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dproduct.path=/home/talend/talend_studio 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=http://company/updatesite 
      -Dpatch.path=D:/patches/updateXXX.zip 
      -Ddocker.push.registry=registry.example.com/group/project 
      -Ddocker.push.username=TalendUser 
      -Ddocker.push.password=V3ryCompl3xPwd 
      -Dtalend.docker.name=cicd4talend 
      -Xms1024m 
      -Xmx3096m'
      goals: 'clean deploy'
      Note: Read the YAML syntax documentation for more information on supported formats for multiline strings.