Skip to main content

Defining the Maven options to build your project

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'
      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'
      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'
      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'
      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'
      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'
      Read the YAML syntax documentation for more information on supported formats for multiline strings.
    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'
      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'
      Read the YAML syntax documentation for more information on supported formats for multiline strings.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!