メイン コンテンツをスキップする

Mavenオプションを定義してプロジェクトをビルド

Mavenのビルドコマンドはデプロイメントのニーズに適合させることができます。コマンドの例は次のとおりです。

  • CICDプロジェクトのアーティファクトを.jarファイルか.zipファイルとしてビルド、テスト、パッケージ化し、Nexusスナップショットリポジトリーにデプロイメントする場合:
    options: '-f <ProjectName>/poms/pom.xml 
    -s <PathToDirectory>/maven_settings.xml 
    -Dlicense.path=<PathToDirectory>/license 
    -Dtalend.studio.p2.base=<P2BaseURL> 
    -Dtalend.studio.p2.update=<P2UpdateURL> 
    -Pnexus
    -DaltDeploymentRepository=snapshots::default::http://XXX:8081/repository/snapshots/ 
    -fae 
    -e'
    goals: 'deploy'
    • Groovyスクリプトの例:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml  
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Pnexus
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'''
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、Groovy構文のドキュメンテーションをお読みください。

    • Yamlスクリプトの例:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Pnexus
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、YAML構文のドキュメンテーションをお読みください。

    カスタムコンポーネントを使用するジョブの例(カスタムコンポーネントが保存されているアーティファクトリポジトリーをポイントする追加のパラメーターが必要です)。

    • Groovyの例:

      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
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Pnexus
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'''
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、Groovy構文のドキュメンテーションをお読みください。

    • YAMLの例:

      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
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Pnexus
      -DaltDeploymentRepository=snapshots::default::http://nexus:8081/repository/snapshots/ 
      -fae 
      -e'
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、YAML構文のドキュメンテーションをお読みください。

    コンテキストグループを使用するジョブの例:
    • Groovyの例:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/parent_0.1 
      -am  
      -Dlicense.path=/home/talend/talend_studio/license
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Dtalend.job.context=dev 
      -Dtalend.job.applyContextToChildren=true 
      -fae 
      -e'''
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、Groovy構文のドキュメンテーションをお読みください。

    • YAMLの例:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -pl jobs/process/parent_0.1 
      -am  
      -Dlicense.path=/home/talend/talend_studio/license
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/R2023-02
      -Dtalend.job.context=dev 
      -Dtalend.job.applyContextToChildren=true 
      -fae 
      -e'
      goals: 'deploy'

      サポートされているマルチライン文字列の形式については、YAML構文のドキュメンテーションをお読みください。

    情報メモ注: 指定したコンテキストグループがジョブに存在しない場合は、デフォルトのコンテキストグループが適用されます。
  • CICDプロジェクトのアーティファクトを.jarファイルか.zipファイルとしてビルド、クリーニング、テスト、パッケージ化し、Dockerレジストリーにデプロイメントする場合:
    options: '-f <ProjectName>/poms/pom.xml 
    -s <PathToDirectory>/maven_settings.xml 
    -Dlicense.path=<PathToDirectory>/license 
    -Dtalend.studio.p2.base=<updatesiteURL> 
    -Dtalend.studio.p2.update=<updatefolderPathOrURL> 
    -Pdocker
    -Djkube.docker.push.registry=<DockerRegistryName> 
    -Djkube.docker.username=<Dockerusername> 
    -Djkube.docker.password=<DockerPassword> 
    -Dtalend.docker.name=<DockerImageName> 
    -Xms1024m -Xmx3096m'
    goals: 'clean deploy'
    • Groovyスクリプトの例:

      options: '''-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/updateXXX.zip
      -Pdocker
      -Djkube.docker.push.registry=registry.example.com/group/project 
      -Djkube.docker.username=TalendUser 
      -Djkube.docker.password=V3ryCompl3xPwd 
      -Dtalend.docker.name=cicd4talend
      -Xms1024m 
      -Xmx3096m'''
      goals: 'clean deploy'

      サポートされているマルチライン文字列の形式については、Groovy構文のドキュメンテーションをお読みください。

    • YAMLスクリプトの例:

      options: '-f CICD/poms/pom.xml 
      -s /home/talend/CI_dir/maven_settings.xml 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dtalend.studio.p2.base=https://update.talend.com/Studio/8/base
      -Dtalend.studio.p2.update=https://update.talend.com/Studio/8/updates/updateXXX.zip
      -Pdocker
      -Djkube.docker.push.registry=registry.example.com/group/project 
      -Djkube.docker.username=TalendUser 
      -Djkube.docker.password=V3ryCompl3xPwd 
      -Dtalend.docker.name=cicd4talend
      -Xms1024m 
      -Xmx3096m'
      goals: 'clean deploy'

      サポートされているマルチライン文字列の形式については、YAML構文のドキュメンテーションをお読みください。

このページは役に立ちましたか?

このページまたはコンテンツに、タイポ、ステップの省略、技術的エラーなどの問題が見つかった場合は、お知らせください。改善に役立たせていただきます。