From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

How to publish a Job using a custom component with Continuous Integration

Problem Description

When publishing a Job with a custom component using Jenkins and Maven, Jenkins throws an error similar to the following:

[ERROR] Failed to execute goal on project sample: 
Could not resolve dependencies for project org.example.custom_component_test.job:sample:jar:0.1.0: 
Could not find artifact com.company:company-component:jar:0.1.4 
in talend-custom-libs-release (http://10.148.0.27:8081/repository/talend-custom-libs-release/) -> [Help 2]
org.apache.maven.lifecycle.LifecycleExecutionException: 
Failed to execute goal on project sample: 
Could not resolve dependencies for project org.example.custom_component_test.job:sample:jar:0.1.0: 
Could not find artifact com.company:company-component:jar:0.1.4 
in talend-custom-libs-release (http://10.148.0.27:8081/repository/talend-custom-libs-release/)

 

Root Cause

The standard Maven command and options require additional configuration when publishing a Job that uses a custom component.

 

Solution

Add the following -Dcomponents parameters to the CI Maven command:

-Dcomponents.nexus.user=<user> 
-Dcomponents.nexus.password=<password> 
-Dcomponents.nexus.url=http://localhost:8081/artifactory 
-Dcomponents.nexus.repository=lib-releases 
-Dcomponents.nexus.repository.snapshot=lib-snapshots

Where:

  • lib-releases is the Talend custom lib release repository
  • lib-snapshots is the Talend custom lib snapshot repository

Your command and parameters should look similar to this:

mvn -f THIS_IS_PROJECT_NAME/poms/pom.xml clean deploy 
-s /path/to/settings.xml
-fn -e 
-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

For more information, see Talend custom Maven build options available in the Talend Help Center.

 

For more information on CI/CD tools, see the following:

CI/CD with Azure DevOps

CI/CD with Jenkins

Version history
Revision #:
10 of 10
Last update:
‎05-28-2020 01:08 PM
Updated by:
 
Contributors